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/check.cpp | 4 ++++ source/slang/slang.cpp | 3 +++ 2 files changed, 7 insertions(+) diff --git a/source/slang/check.cpp b/source/slang/check.cpp index e100cbd1d..1b17ec49f 100644 --- a/source/slang/check.cpp +++ b/source/slang/check.cpp @@ -6606,6 +6606,10 @@ namespace Slang { if (auto typeParamRef = memberRef.As()) { + if (aa >= context.argCount) + { + return false; + } auto arg = context.getArg(aa++); TypeExp typeExp; 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 From c1fe5f295e843d10e24ae0d053fc3813a29aec89 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 30 Jan 2019 20:46:03 -0800 Subject: fixup x86 compiler error. --- source/slang/check.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/slang/check.cpp b/source/slang/check.cpp index 1b17ec49f..74adaccda 100644 --- a/source/slang/check.cpp +++ b/source/slang/check.cpp @@ -6601,7 +6601,7 @@ namespace Slang candidate.subst = genSubst; auto& checkedArgs = genSubst->args; - int aa = 0; + uint32_t aa = 0; for (auto memberRef : getMembers(genericDeclRef)) { if (auto typeParamRef = memberRef.As()) -- cgit v1.2.3