diff options
author | Sam Clegg <sbc@chromium.org> | 2019-12-05 13:09:21 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-05 13:09:21 -0600 |
commit | a28343a33ed28b4d5c83c37e350aceaf09b5246f (patch) | |
tree | 084a487cdf79e8025246d2a85d5578c113c9ad51 /src/wasm/wasm-validator.cpp | |
parent | cbf121df96cfce5038f52ed04f9780e19ed3b762 (diff) | |
download | binaryen-a28343a33ed28b4d5c83c37e350aceaf09b5246f.tar.gz binaryen-a28343a33ed28b4d5c83c37e350aceaf09b5246f.tar.bz2 binaryen-a28343a33ed28b4d5c83c37e350aceaf09b5246f.zip |
Add string parameter to WASM_UNREACHABLE (#2499)
This works more like llvm's unreachable handler in that is preserves
information even in release builds.
Diffstat (limited to 'src/wasm/wasm-validator.cpp')
-rw-r--r-- | src/wasm/wasm-validator.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index d3f03b76c..75121d4f4 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -1183,7 +1183,7 @@ void FunctionValidator::validateMemBytes(uint8_t bytes, case anyref: // anyref cannot be stored in memory case exnref: // exnref cannot be stored in memory case none: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("unexpected type"); case unreachable: break; } @@ -1387,7 +1387,7 @@ void FunctionValidator::visitBinary(Binary* curr) { break; } case InvalidBinary: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invliad binary op"); } shouldBeTrue(Features::get(curr->op) <= getModule()->features, curr, @@ -1601,7 +1601,7 @@ void FunctionValidator::visitUnary(Unary* curr) { shouldBeEqual(curr->value->type, v128, curr, "expected v128 operand"); break; case InvalidUnary: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid unary op"); } shouldBeTrue(Features::get(curr->op) <= getModule()->features, curr, @@ -1866,7 +1866,7 @@ void FunctionValidator::validateAlignment( case anyref: // anyref cannot be stored in memory case exnref: // exnref cannot be stored in memory case none: - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid type"); } } @@ -1995,7 +1995,7 @@ static void validateExports(Module& module, ValidationInfo& info) { name, "module event exports must be found"); } else { - WASM_UNREACHABLE(); + WASM_UNREACHABLE("invalid ExternalKind"); } Name exportName = exp->name; info.shouldBeFalse(exportNames.count(exportName) > 0, |