summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-binary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm-binary.cpp')
-rw-r--r--src/wasm/wasm-binary.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index 9368325b0..5326972b0 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -2560,7 +2560,12 @@ void WasmBinaryBuilder::readFunctions() {
assert(depth == 0);
assert(breakStack.empty());
assert(breakTargetNames.empty());
- assert(exceptionTargetNames.empty());
+ if (!exceptionTargetNames.empty()) {
+ // A delegate index existed that did not end up referring to any valid
+ // outer try-catch (we remove valid ones from exceptionTargetNames as we
+ // go).
+ throwError("exceptionTargetNames not empty - invalid delegate");
+ }
if (!expressionStack.empty()) {
throwError("stack not empty on function exit");
}