summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source/slang/slang.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index 6fe778435..996b539ee 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -825,11 +825,11 @@ SLANG_NO_THROW slang::IModule* SLANG_MCALL Linkage::loadModule(
const char* moduleName,
slang::IBlob** outDiagnostics)
{
+ DiagnosticSink sink(getSourceManager(), Lexer::sourceLocationLexer);
try
{
auto name = getNamePool()->getName(moduleName);
- DiagnosticSink sink(getSourceManager(), Lexer::sourceLocationLexer);
auto module = findOrImportModule(name, SourceLoc(), &sink);
sink.getBlobIfNeeded(outDiagnostics);
@@ -838,6 +838,7 @@ SLANG_NO_THROW slang::IModule* SLANG_MCALL Linkage::loadModule(
}
catch (const AbortCompilationException&)
{
+ sink.getBlobIfNeeded(outDiagnostics);
return nullptr;
}
}