Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9b2df38070c9fd95acffa874a0d7f4a5656586fd
      
https://github.com/WebKit/WebKit/commit/9b2df38070c9fd95acffa874a0d7f4a5656586fd
  Author: Dan Hecht <[email protected]>
  Date:   2025-11-12 (Wed, 12 Nov 2025)

  Changed paths:
    A JSTests/wasm/stress/catch-nested-expr-stack-and-locals.js
    A JSTests/wasm/stress/catch-nested-rethrow.js
    M Source/JavaScriptCore/wasm/WasmBBQJIT.cpp
    M Source/JavaScriptCore/wasm/WasmIPIntSlowPaths.cpp
    M Source/JavaScriptCore/wasm/WasmOMGIRGenerator.cpp

  Log Message:
  -----------
  [JSC] Wasm: Fix OMG exceptions with nested catch
https://bugs.webkit.org/show_bug.cgi?id=300395
rdar://162211758

Reviewed by Yusuke Suzuki.

OMGIRGenerator::emitCatchImpl consumes the scratch buffer produced by
the stack map generated by OMGIRGenerator::preparePatchpointForExceptions
which has the catch exception after the expressions of a Catch block.
However, when Options::useWasmIPInt()==true, connectControlAtEntrypoint()
does not load the exception value.

Added new tests to verify nested catch rethrow exception and
expression slots (and locals) are restored correctly when entering an
inner catch handler, as well verify that this state remains correct
for the OSR loop case.

* JSTests/wasm/stress/catch-nested-expr-stack-and-locals.js: Added.
(async testExpressionStack):
(async testExpressionStackWithOSR):
* JSTests/wasm/stress/catch-nested-rethrow.js: Added.
(async testBasic):
(async testWithOSR):
* Source/JavaScriptCore/wasm/WasmOMGIRGenerator.cpp:
(JSC::Wasm::OMGIRGenerator::connectControlAtEntrypoint):
(JSC::Wasm::OMGIRGenerator::addLoop):
(JSC::Wasm::OMGIRGenerator::emitCatchImpl):
(JSC::Wasm::OMGIRGenerator::emitCatchTableImpl):

Originally-landed-as: 297297.521@safari-7622-branch (6f9b4a803bef). 
rdar://164211289
Canonical link: https://commits.webkit.org/302967@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to