diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/passes/Print.cpp | 15 | ||||
-rw-r--r-- | src/wasm/wasm-type.cpp | 2 |
2 files changed, 7 insertions, 10 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index d4b86f93d..a92b0a16a 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -2832,9 +2832,7 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> { void handleSignature(HeapType curr, Name name = Name()) { Signature sig = curr.getSignature(); - bool hasSupertype = - !name.is() && (getTypeSystem() == TypeSystem::Nominal || - getTypeSystem() == TypeSystem::Isorecursive); + bool hasSupertype = !name.is() && !!curr.getSuperType(); if (hasSupertype) { o << "(func_subtype"; } else { @@ -2891,8 +2889,7 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> { } } void handleArray(HeapType curr) { - bool hasSupertype = getTypeSystem() == TypeSystem::Nominal || - getTypeSystem() == TypeSystem::Isorecursive; + bool hasSupertype = !!curr.getSuperType(); if (hasSupertype) { o << "(array_subtype "; } else { @@ -2906,8 +2903,7 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> { o << ')'; } void handleStruct(HeapType curr) { - bool hasSupertype = getTypeSystem() == TypeSystem::Nominal || - getTypeSystem() == TypeSystem::Isorecursive; + bool hasSupertype = !!curr.getSuperType(); const auto& fields = curr.getStruct().fields; if (hasSupertype) { o << "(struct_subtype "; @@ -3038,8 +3034,9 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> { o << '('; printMajor(o, "func "); printName(curr->name, o); - if (getTypeSystem() == TypeSystem::Nominal || - getTypeSystem() == TypeSystem::Isorecursive) { + if (currModule && currModule->features.hasGC() && + (getTypeSystem() == TypeSystem::Nominal || + getTypeSystem() == TypeSystem::Isorecursive)) { o << " (type "; printHeapType(o, curr->type, currModule) << ')'; } diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp index 9ac23bd96..da40bb10e 100644 --- a/src/wasm/wasm-type.cpp +++ b/src/wasm/wasm-type.cpp @@ -44,7 +44,7 @@ namespace wasm { -static TypeSystem typeSystem = TypeSystem::Equirecursive; +static TypeSystem typeSystem = TypeSystem::Isorecursive; void setTypeSystem(TypeSystem system) { typeSystem = system; } |