summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-10-14 01:01:00 -0700
committerGitHub <noreply@github.com>2021-10-14 01:01:00 -0700
commit87e7c49fbfccd54be0d1cee61fba8f309b1f792e (patch)
tree4b1d1bee76596f8a1dd8a5eddc07f9d26ba08e73 /source
parented4c58bd3932b0e4ed74096c6c8ed239ba73d45d (diff)
Fix a crash in `specializeDynamicAssociatedTypeLookup`. (#1979)
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp1
-rw-r--r--source/slang/slang.cpp4
2 files changed, 5 insertions, 0 deletions
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;