From 46529df2c4f73a4655bdd79d48004f29374a99a8 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 6 Nov 2023 14:40:38 -0800 Subject: Fix ICE when lowering an associatedtype declref from an derived interface. (#3312) * Fix ICE when lowering an associatedtype declref from an derived interface. * Fixes. * Fix test. * Fix GLSL/SPIRV image subscript swizzle store regression. * Fix. --------- Co-authored-by: Yong He --- source/slang/slang-check-expr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/slang/slang-check-expr.cpp') diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp index b76fe0003..5ca0af1c9 100644 --- a/source/slang/slang-check-expr.cpp +++ b/source/slang/slang-check-expr.cpp @@ -581,6 +581,12 @@ namespace Slang SourceLoc loc, Expr* originalExpr) { + if (!item.declRef) + { + originalExpr->type = QualType(m_astBuilder->getErrorType()); + return originalExpr; + } + // We could be referencing a decl that will be synthesized. If so create a placeholder // and return a DeclRefExpr to it. if (auto lookupResultExpr = maybeUseSynthesizedDeclForLookupResult(item, originalExpr)) -- cgit v1.2.3