Skip to content

JIT: Initialize Wasm resume IP to a rethrowing value - #133649

Open
AndyAyersMS wants to merge 2 commits into
dotnet:mainfrom
AndyAyersMS:fix/wasm-r2r-resume-ip-init
Open

JIT: Initialize Wasm resume IP to a rethrowing value#133649
AndyAyersMS wants to merge 2 commits into
dotnet:mainfrom
AndyAyersMS:fix/wasm-r2r-resume-ip-init

Conversation

@AndyAyersMS

@AndyAyersMS AndyAyersMS commented Sep 10, 2026

Copy link
Copy Markdown
Member

Initialize resume IP on entry to zero (a non-resuming value for all trys), and reset it to this value if a try resumes post-catch.

This prevents a try from seeing a stale resume IP if its catch never reaches the catchret.

Fixes #133613.

Note

This pull request description was generated by GitHub Copilot.

AndyAyersMS and others added 2 commits September 10, 2026 14:42
Fixes dotnet#133613.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 10, 2026 23:42
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 10, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 6 pipeline(s).
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@AndyAyersMS

Copy link
Copy Markdown
Member Author

@jakobbotsch PTAL
fyi @dotnet/wasm-contrib

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Add coverage for first-use resume dispatch before any resume IP has been stored.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Initializes and resets the Wasm exception-resumption IP to prevent stale dispatch state.

Changes:

  • Initializes the resume IP to zero.
  • Clears resume state after successful resumption.
  • Adds repeated-catch regression coverage.
File summaries
File Changes
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/ExceptionTests.cs Adds regression coverage for repeated catches.
src/coreclr/jit/fgwasm.cpp Resets resume state after accepted resumption.
src/coreclr/jit/codegenwasm.cpp Initializes resume state in the Wasm prolog.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

@davidwrighton davidwrighton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but I wonder if we should flow the resumeip through the wasm exception to avoid needing to set/reset the value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[browser][CoreCLR][R2R] Array.BinarySearch comparer exception aborts library tests

3 participants