Uh oh!
There was an error while loading. Please reload this page.
[Wasm RyuJit]: don't skip top-level catchrets when marking try resumption - #129205
Conversation
In FlowGraphTryRegions::Build, the BBJ_EHCATCHRET check sat below the early bailout on hasTryIndex, so the catchret of an outer catch was never marking its try region as requiring runtime resumption. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
AndyAyersMS
commented
Jun 10, 2026
@dotnet/jit-contrib PTAL Fixes a dumb logic bug. With this and #129197 I'm able to resume after catch in simple R2R methods. Haven't tested more widely yet. |
There was a problem hiding this comment.
Pull request overview
Adjusts FlowGraphTryRegions::Build so BBJ_EHCATCHRET blocks always mark their associated “dispatching try” region as requiring runtime resumption, even when the catchret block itself has no TryIndex (e.g., outermost catch).
Changes:
- Move the
BBJ_EHCATCHREThandling before the early!block->hasTryIndex()bailout. - Preserve existing behavior for try-region membership/entry-edge discovery while ensuring top-level catchrets are no longer skipped.
Uh oh!
There was an error while loading. Please reload this page.
AndyAyersMS
commented
Jun 10, 2026
SPC is not crossgenning cleanly with this fix. Failure is clearly related. |
throw helpers associated with the try. Remove an unneded arg on a folded overflow throw helper call. This is harmless on native targets but causes a sig mismatch issue for Wasm.
JulieLeeMSFT
left a comment
There was a problem hiding this comment.
LGTM. The fix extends loop intervals to the right to fully enclose try region's throw helper blocks (prevents loop/try straddle).
AndyAyersMS
commented
Jun 11, 2026
/ba-g unrelated legs timing out |
Uh oh!
There was an error while loading. Please reload this page.
…tion (dotnet#129205) In FlowGraphTryRegions::Build, the BBJ_EHCATCHRET check sat below the early bailout on hasTryIndex, so the catchret of an outer catch was never marking its try region as requiring runtime resumption. Also: ensure loops that partially contain trys have their wasm-interval lengths extended to encompass any throw helpers associated with the try. Also: fix some random extra argument added to a the overflow helper in some cases. This is all platform and has been in the code forever. On native it is somewhat harmless to pass unexpected extra args (especially if register args). On Wasm it is not. Reminder that for Wasm control flow we can always move the end of a Wasm loop later; the extent just delineates where you can branch back to the loop head, not the actual extent of the loop. Likewise we can always move the start of a block earlier. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tion (#129205) In FlowGraphTryRegions::Build, the BBJ_EHCATCHRET check sat below the early bailout on hasTryIndex, so the catchret of an outer catch was never marking its try region as requiring runtime resumption. Also: ensure loops that partially contain trys have their wasm-interval lengths extended to encompass any throw helpers associated with the try. Also: fix some random extra argument added to a the overflow helper in some cases. This is all platform and has been in the code forever. On native it is somewhat harmless to pass unexpected extra args (especially if register args). On Wasm it is not. Reminder that for Wasm control flow we can always move the end of a Wasm loop later; the extent just delineates where you can branch back to the loop head, not the actual extent of the loop. Likewise we can always move the start of a block earlier. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
In FlowGraphTryRegions::Build, the BBJ_EHCATCHRET check sat below the early bailout on hasTryIndex, so the catchret of an outer catch was never marking its try region as requiring runtime resumption.
Also: ensure loops that partially contain trys have their wasm-interval lengths extended to encompass any throw helpers associated with the try.
Also: fix some random extra argument added to a the overflow helper in some cases. This is all platform and has been in the code forever. On native it is somewhat harmless to pass unexpected extra args (especially if register args). On Wasm it is not.
Reminder that for Wasm control flow we can always move the end of a Wasm loop later; the extent just delineates where you can branch back to the loop head, not the actual extent of the loop. Likewise we can always move the start of a block earlier.