Commit 948e51fb authored by Thibaud Michaud's avatar Thibaud Michaud Committed by Commit Bot

[wasm][eh] Make delegating to an unwind block invalid

The delegate instruction is only allowed inside the try section of a try
block.

R=ahaas@chromium.org

Bug: chromium:1193169
Change-Id: I71756b18903dc39e487721b401d18bc4e213cbff
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2791565
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73720}
parent 11110c30
......@@ -2582,7 +2582,7 @@ class WasmFullDecoder : public WasmDecoder<validate> {
return 0;
}
if (target->is_try_catch() || target->is_try_catchall() ||
target->is_try_catchall()) {
target->is_try_unwind()) {
this->DecodeError(
"cannot delegate inside the catch handler of the target");
}
......
......@@ -2934,6 +2934,11 @@ TEST_F(FunctionBodyDecoderTest, TryDelegate) {
WASM_TRY_DELEGATE(WASM_STMTS(kExprThrow, ex), 0), kExprEnd},
kAppendEnd,
"cannot delegate inside the catch handler of the target");
ExpectFailure(sigs.v_v(),
{WASM_TRY_OP, kExprUnwind,
WASM_TRY_DELEGATE(WASM_STMTS(kExprThrow, ex), 0), kExprEnd},
kAppendEnd,
"cannot delegate inside the catch handler of the target");
ExpectFailure(
sigs.v_v(),
{WASM_BLOCK(WASM_TRY_OP, WASM_TRY_DELEGATE(WASM_STMTS(kExprThrow, ex), 3),
......
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