summaryrefslogtreecommitdiffstats
path: root/source/slang/slang.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-08-31 11:08:54 -0700
committerGitHub <noreply@github.com>2017-08-31 11:08:54 -0700
commit620734080f825cb205b887fa1d6203e35dd60663 (patch)
treeb7c3c0003d6d8d67f3f04f136af083deaa5e591b /source/slang/slang.cpp
parent227f9f5a9d8ac0d88079b6175b3f31c8f05fabd0 (diff)
parent60ed10520dd9af285e7d865445427caedc7e1ec6 (diff)
Merge pull request #174 from tfoleyNV/modifier-lowering-fix
Fix some issues around cloned modifiers.
Diffstat (limited to 'source/slang/slang.cpp')
-rw-r--r--source/slang/slang.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index 293b6bf9e..65abbb3f2 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -859,6 +859,16 @@ SLANG_API int spCompile(
{
auto req = REQ(request);
+#if 1
+ // By default we'd like to catch as many internal errors as possible,
+ // and report them to the user nicely (rather than just crash their
+ // application). Internally Slang currently uses exceptions for this.
+ //
+ // TODO: Consider using `setjmp()`-style escape so that we can work
+ // with applications that disable exceptions.
+ //
+ // TODO: Consider supporting Windows "Structured Exception Handling"
+ // so that we can also recover from a wider class of crashes.
try
{
int anyErrors = req->executeActions();
@@ -869,6 +879,14 @@ SLANG_API int spCompile(
req->mSink.diagnose(Slang::SourceLoc(), Slang::Diagnostics::compilationAborted);
return 1;
}
+#else
+ // When debugging, we probably don't want to filter out any errors, since
+ // we are probably trying to root-cause and *fix* those errors.
+ {
+ int anyErrors = req->executeActions();
+ return anyErrors;
+ }
+#endif
}
SLANG_API int