summaryrefslogtreecommitdiff
path: root/source/slang/slang-syntax.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-05-10 19:27:47 -0700
committerGitHub <noreply@github.com>2023-05-10 19:27:47 -0700
commit952e04466a18e9d03fcb018ce9213f34b93ca74a (patch)
treece0597052bc90c7335c76ad2be73844878a8c9f7 /source/slang/slang-syntax.h
parent99bc31fdd6fd9a6cbce6afd5fa9b52fb47873f61 (diff)
Fix intellisense and autodiff crashes. (#2879)
* Fix intellisense crash. * Fix a bug in updateElement simplification. * cleanup. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-syntax.h')
-rw-r--r--source/slang/slang-syntax.h2
1 files changed, 2 insertions, 0 deletions
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);
}