summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source/slang/slang-ir-peephole.cpp2
-rw-r--r--source/slang/slang-syntax.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/source/slang/slang-ir-peephole.cpp b/source/slang/slang-ir-peephole.cpp
index e07d1f9c4..376795855 100644
--- a/source/slang/slang-ir-peephole.cpp
+++ b/source/slang/slang-ir-peephole.cpp
@@ -50,7 +50,7 @@ struct PeepholeContext : InstPassBase
return false;
isAccessChainEqual = true;
- for (UInt i = 0; i < (UInt)chainKey.getCount(); i++)
+ for (UInt i = 0; i < updateInst->getAccessKeyCount(); i++)
{
if (updateInst->getAccessKey(i) != chainKey[i])
{
diff --git a/source/slang/slang-syntax.h b/source/slang/slang-syntax.h
index 3ac258f08..52df3a0e0 100644
--- a/source/slang/slang-syntax.h
+++ b/source/slang/slang-syntax.h
@@ -194,6 +194,8 @@ namespace Slang
inline Type* getType(ASTBuilder* astBuilder, SubstExpr<Expr> expr)
{
+ if (!expr)
+ return astBuilder->getErrorType();
return substituteType(expr.getSubsts(), astBuilder, expr.getExpr()->type);
}