From a28343a33ed28b4d5c83c37e350aceaf09b5246f Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 5 Dec 2019 13:09:21 -0600 Subject: Add string parameter to WASM_UNREACHABLE (#2499) This works more like llvm's unreachable handler in that is preserves information even in release builds. --- src/asm2wasm.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/asm2wasm.h') diff --git a/src/asm2wasm.h b/src/asm2wasm.h index 24e9ddc76..048d363ef 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -1548,7 +1548,7 @@ void Asm2WasmBuilder::processAsm(Ref ast) { break; } default: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } } else { assert(old == none); @@ -2060,7 +2060,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { ret->op = NegFloat32; ret->type = Type::f32; } else { - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected asm type"); } return ret; } else if (ast[1] == B_NOT) { @@ -2195,7 +2195,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { ret->type = value->type; return ret; } else { - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); } } if (name == Math_floor || name == Math_sqrt || name == Math_ceil) { @@ -2328,7 +2328,7 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) { process(ast[2][2]), asmToWasmType(view.type)); } - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected atomic op"); } bool tableCall = false; if (wasmOnly) { -- cgit v1.2.3