summaryrefslogtreecommitdiffstats
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang.cpp')
-rw-r--r--source/slang/slang.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index 89db62ec8..caa50ad0e 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -571,7 +571,7 @@ void Session::addBuiltinSource(
OutputDebugStringA(compileRequest->mDiagnosticOutput.Buffer());
#endif
- assert(!"error in stdlib");
+ SLANG_UNEXPECTED("error in Slang standard library");
}
// Extract the AST for the code we just parsed
@@ -831,8 +831,16 @@ SLANG_API int spCompile(
{
auto req = REQ(request);
- int anyErrors = req->executeActions();
- return anyErrors;
+ try
+ {
+ int anyErrors = req->executeActions();
+ return anyErrors;
+ }
+ catch (...)
+ {
+ req->mSink.diagnose(Slang::CodePosition(), Slang::Diagnostics::compilationAborted);
+ return 1;
+ }
}
SLANG_API int