Commit a7776e30 authored by Thibaud Michaud's avatar Thibaud Michaud Committed by V8 LUCI CQ

[wasm][interpreter] Fix catch-less try

Because of catch-less try blocks, we have to check the exception stack
one more time so that we don't try to rethrow to an outer try scope if
this is already the outermost one.

R=clemensb@chromium.org

Bug: chromium:1219746
Change-Id: I6ad7e4afec669f04bc10197998db5d6eb38a2205
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2983205Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75355}
parent 9701d4a4
......@@ -710,6 +710,14 @@ TEST(Regress1212396) {
CHECK_EQ(42, r.CallInterpreter());
}
TEST(Regress1219746) {
TestSignatures sigs;
EXPERIMENTAL_FLAG_SCOPE(eh);
WasmRunner<int32_t> r(TestExecutionTier::kInterpreter);
BUILD(r, kExprTry, kVoidCode, kExprI32Const, 0, kExprEnd);
CHECK_EQ(0, r.CallInterpreter());
}
} // namespace test_run_wasm_exceptions
} // namespace wasm
} // namespace internal
......
......@@ -942,7 +942,7 @@ class SideTable : public ZoneObject {
!unreachable,
stack_height >= c->else_label->target_stack_height);
stack_height = c->else_label->target_stack_height;
rethrow = !unreachable;
rethrow = !unreachable && !exception_stack.empty();
}
}
c->end_label->Bind(i.pc() + 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment