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-ir-specialize-dynamic-associatedtype-lookup.cpp | 1 + source/slang/slang.cpp | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'source') diff --git a/source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp b/source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp index a5d19b517..059531107 100644 --- a/source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp +++ b/source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp @@ -247,6 +247,7 @@ struct AssociatedTypeLookupSpecializationContext continue; use->set(witnessTableIDType); } + sharedContext->sharedBuilderStorage.deduplicateAndRebuildGlobalNumberingMap(); } } 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