summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/wasm/wasm-type.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp
index 284d6d7d6..b65debc73 100644
--- a/src/wasm/wasm-type.cpp
+++ b/src/wasm/wasm-type.cpp
@@ -2967,7 +2967,11 @@ TypeBuilder::BuildResult TypeBuilder::build() {
// Note built signature types. See comment in `HeapType::HeapType(Signature)`.
for (auto type : state.results) {
- if (type.isSignature() && (getTypeSystem() == TypeSystem::Nominal)) {
+ // Do not cache types with explicit supertypes (that is, whose supertype is
+ // not HeapType::func). We don't want to reuse such types because then we'd
+ // be adding subtyping relationships that are not in the input.
+ if (type.isSignature() && (getTypeSystem() == TypeSystem::Nominal) &&
+ !type.getSuperType()) {
nominalSignatureCache.insertType(type);
}
}