Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WASM unreachable code validation is broken
https://bugs.webkit.org/show_bug.cgi?id=265425 rdar://103288466 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): Originally-landed-as: 274097.7@webkit-2024.2-embargoed (ab8e4a4470bb). rdar://128090590 Canonical link: https://commits.webkit.org/278882@main
- Loading branch information