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/passes/AlignmentLowering.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/passes/AlignmentLowering.cpp') diff --git a/src/passes/AlignmentLowering.cpp b/src/passes/AlignmentLowering.cpp index 05ec2892f..d659fcb69 100644 --- a/src/passes/AlignmentLowering.cpp +++ b/src/passes/AlignmentLowering.cpp @@ -103,10 +103,10 @@ struct AlignmentLowering : public WalkerPass> { i32), builder.makeConst(Literal(int32_t(16))))); } else { - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid alignment"); } } else { - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid size"); } replaceCurrent( builder.makeBlock({builder.makeLocalSet(temp, curr->ptr), ret})); @@ -199,10 +199,10 @@ struct AlignmentLowering : public WalkerPass> { builder.makeConst(Literal(int32_t(16)))), i32)); } else { - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid alignment"); } } else { - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid size"); } block->finalize(); replaceCurrent(block); -- cgit v1.2.3