diff options
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r-- | src/passes/Print.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 41e800352..9f283ddcc 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -1977,6 +1977,10 @@ struct PrintExpressionContents TypeNamePrinter(o, wasm).print(curr->rtt->type.getHeapType()); } void visitArrayGet(ArrayGet* curr) { + if (curr->ref->type == Type::unreachable) { + printUnreachableReplacement(); + return; + } const auto& element = curr->ref->type.getHeapType().getArray().element; if (element.type == Type::i32 && element.packedType != Field::not_packed) { if (curr->signed_) { @@ -1990,6 +1994,10 @@ struct PrintExpressionContents TypeNamePrinter(o, wasm).print(curr->ref->type.getHeapType()); } void visitArraySet(ArraySet* curr) { + if (curr->ref->type == Type::unreachable) { + printUnreachableReplacement(); + return; + } printMedium(o, "array.set "); TypeNamePrinter(o, wasm).print(curr->ref->type.getHeapType()); } @@ -2376,6 +2384,20 @@ struct PrintSExpression : public UnifiedExpressionVisitor<PrintSExpression> { } visitExpression(curr); } + void visitArraySet(ArraySet* curr) { + if (curr->ref->type == Type::unreachable) { + printUnreachableReplacement(curr); + return; + } + visitExpression(curr); + } + void visitArrayGet(ArrayGet* curr) { + if (curr->ref->type == Type::unreachable) { + printUnreachableReplacement(curr); + return; + } + visitExpression(curr); + } // Module-level visitors void handleSignature(Signature curr, Name name = Name()) { o << "(func"; |