Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick 274097.7@webkit-2024.2-embargoed (ab8e4a4470bb). https://…
…bugs.webkit.org/show_bug.cgi?id=265425 WASM unreachable code validation is broken https://bugs.webkit.org/show_bug.cgi?id=265425 Reviewed by Keith Miller. This patch fixes an assertion failure in the unreachable code parser when the target of a br instruction is a block that was not added into the control stack. The code that checks the br target now takes into account the number of unreachable blocks, if the br instruction is also unreachable. This is similar to the solution employed by parseDelegateTarget and should support cases when block, if, try, and loop were not added to the control stack. * JSTests/wasm/stress/wasm-unreachable-br-block.js: Added. (async test): * Source/JavaScriptCore/wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser<Context>::parseBranchTarget): (JSC::Wasm::FunctionParser<Context>::parseUnreachableExpression): Canonical link: https://commits.webkit.org/274097.7@webkit-2024.2-embargoed Canonical link: https://commits.webkit.org/272448.649@safari-7618-branch Canonical link: https://commits.webkit.org/274313.220@webkitglib/2.44
- Loading branch information