From e8ac658a5db2fadc93c3d317d465eed253e191ed Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 23 May 2023 10:38:00 -0700 Subject: Revert "Update br_on_cast binary and text format (#5734)" (#5740) This reverts commit b7b1d0df29df14634d2c680d1d2c351b624b4fbb. See comment at the end of #5734: It turns out that dropping the old opcodes causes problems for current users, so let's revert this for now, and later we can figure out how best to do the update. --- src/passes/Print.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/passes/Print.cpp') diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp index 4bcc042a1..0d74d43f1 100644 --- a/src/passes/Print.cpp +++ b/src/passes/Print.cpp @@ -2172,9 +2172,10 @@ struct PrintExpressionContents printMedium(o, "br_on_cast "); printName(curr->name, o); o << ' '; - printType(o, curr->ref->type, wasm); - o << ' '; - printType(o, curr->castType, wasm); + if (curr->castType.isNullable()) { + printMedium(o, "null "); + } + printHeapType(o, curr->castType.getHeapType(), wasm); return; case BrOnCastFail: // TODO: These instructions are deprecated, so stop emitting them. @@ -2196,9 +2197,10 @@ struct PrintExpressionContents printMedium(o, "br_on_cast_fail "); printName(curr->name, o); o << ' '; - printType(o, curr->ref->type, wasm); - o << ' '; - printType(o, curr->castType, wasm); + if (curr->castType.isNullable()) { + printMedium(o, "null "); + } + printHeapType(o, curr->castType.getHeapType(), wasm); return; } WASM_UNREACHABLE("Unexpected br_on* op"); -- cgit v1.2.3