diff options
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r-- | src/passes/Print.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index ddd8f9cc1..0f4a314ae 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -108,6 +108,9 @@ bool maybePrintRefShorthand(std::ostream& o, Type type) { case HeapType::data: o << "dataref"; return true; + case HeapType::array: + o << "arrayref"; + return true; case HeapType::string: o << "stringref"; return true; @@ -2234,11 +2237,12 @@ struct PrintExpressionContents TypeNamePrinter(o, wasm).print(curr->ref->type.getHeapType()); } void visitArrayLen(ArrayLen* curr) { - if (printUnreachableOrNullReplacement(curr->ref)) { - return; - } printMedium(o, "array.len "); - TypeNamePrinter(o, wasm).print(curr->ref->type.getHeapType()); + if (curr->ref->type == Type::unreachable) { + TypeNamePrinter(o, wasm).print(HeapType::array); + } else { + TypeNamePrinter(o, wasm).print(curr->ref->type.getHeapType()); + } } void visitArrayCopy(ArrayCopy* curr) { if (printUnreachableOrNullReplacement(curr->srcRef) || @@ -2801,9 +2805,6 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> { void visitArrayGet(ArrayGet* curr) { maybePrintUnreachableOrNullReplacement(curr, curr->ref->type); } - void visitArrayLen(ArrayLen* curr) { - maybePrintUnreachableOrNullReplacement(curr, curr->ref->type); - } // Module-level visitors void printSupertypeOr(HeapType curr, std::string noSuper) { if (auto super = curr.getSuperType()) { |