From 87e7c49fbfccd54be0d1cee61fba8f309b1f792e Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 14 Oct 2021 01:01:00 -0700 Subject: Fix a crash in `specializeDynamicAssociatedTypeLookup`. (#1979) --- source/slang/slang.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index 996b539ee..78f7c7c51 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -1062,6 +1062,10 @@ SLANG_NO_THROW SlangResult SLANG_MCALL Linkage::getTypeConformanceWitnessSequent { auto subType = asInternal(type); auto supType = asInternal(interfaceType); + + if (!subType || !supType) + return SLANG_FAIL; + auto name = getMangledNameForConformanceWitness(subType->getASTBuilder(), subType, supType); auto interfaceName = getMangledTypeName(supType->getASTBuilder(), supType); uint32_t resultIndex = 0; -- cgit v1.2.3