Commit ef3e9cb0 authored by Thibaud Michaud's avatar Thibaud Michaud Committed by Commit Bot

[wasm][eh] Add missing checks before using EH opcodes

R=clemensb@chromium.org

Bug: v8:8091
Change-Id: Id2f0b4635ee235c592a969a41d1f50ed677150f2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2667857Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72490}
parent 910d92e2
...@@ -2538,6 +2538,7 @@ class WasmFullDecoder : public WasmDecoder<validate> { ...@@ -2538,6 +2538,7 @@ class WasmFullDecoder : public WasmDecoder<validate> {
} }
DECODE(Delegate) { DECODE(Delegate) {
CHECK_PROTOTYPE_OPCODE(eh);
BranchDepthImmediate<validate> imm(this, this->pc_ + 1); BranchDepthImmediate<validate> imm(this, this->pc_ + 1);
// -1 because the current try block is not included in the count. // -1 because the current try block is not included in the count.
if (!this->Validate(this->pc_ + 1, imm, control_depth() - 1)) return 0; if (!this->Validate(this->pc_ + 1, imm, control_depth() - 1)) return 0;
...@@ -2566,6 +2567,7 @@ class WasmFullDecoder : public WasmDecoder<validate> { ...@@ -2566,6 +2567,7 @@ class WasmFullDecoder : public WasmDecoder<validate> {
} }
DECODE(CatchAll) { DECODE(CatchAll) {
CHECK_PROTOTYPE_OPCODE(eh);
if (!VALIDATE(!control_.empty())) { if (!VALIDATE(!control_.empty())) {
this->error("catch-all does not match any try"); this->error("catch-all does not match any try");
return 0; return 0;
......
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