From 04f1badc29d41e642597039f9822a6e3aa1138cc Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 30 Jan 2019 17:26:26 -0800 Subject: Fixes crashes at source error. --- source/slang/slang.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index 359848d65..e332ef588 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -912,6 +912,9 @@ RefPtr CompileRequest::loadModule( if( errorCountAfter != errorCountBefore ) { mSink.diagnose(srcLoc, Diagnostics::errorInImportedModule); + } + if (errorCountAfter) + { // Something went wrong during the parsing, so we should bail out. return nullptr; } -- cgit v1.2.3