Skip to content

[wasm][coreclr] Fix prestub of methods with IL helper stubs - #124873

Merged
radekdoulik merged 6 commits into
dotnet:mainfrom
radekdoulik:clr-wasm-prestub-il-helpers
Feb 27, 2026
Merged

[wasm][coreclr] Fix prestub of methods with IL helper stubs#124873
radekdoulik merged 6 commits into
dotnet:mainfrom
radekdoulik:clr-wasm-prestub-il-helpers

Conversation

@radekdoulik

Copy link
Copy Markdown
Member

@radekdoulikradekdoulik added this to the Future milestone Feb 25, 2026
@radekdoulikradekdoulik added the arch-wasm WebAssembly architecture label Feb 25, 2026
CopilotAI review requested due to automatic review settings February 25, 2026 21:44
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

CopilotAI 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.

Pull request overview

This PR fixes a WASM/CoreCLR interpreter prestub issue where methods implemented via managed IL helper stubs could end up publishing an entrypoint that maps to the helperMethodDesc, breaking MethodDesc lookups and access checks (manifesting as MethodAccessException, e.g. around delegate construction).

Changes:

  • Update MethodDesc::DoPrestub (FCall + managed-impl + portable entrypoints) to publish this method’s own PortableEntryPoint and attach interpreter data to it, instead of reusing the helper’s portable entrypoint.
  • Enable interpreter callsite access-check callouts on WASM by removing the #ifndef TARGET_WASM guard.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

FileDescription
src/coreclr/vm/prestub.cppPublishes the current method’s portable entrypoint and sets interpreter data for managed FCall helper-stub scenarios.
src/coreclr/interpreter/compiler.cppEnables emitting callsite access-check callouts on WASM by removing a WASM-only compile-time exclusion.

Comment threadsrc/coreclr/vm/prestub.cpp Outdated
Comment threadsrc/coreclr/vm/prestub.cpp
Comment threadsrc/coreclr/vm/prestub.cpp
Comment threadsrc/coreclr/vm/prestub.cpp Outdated
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
CopilotAI review requested due to automatic review settings February 26, 2026 14:03

CopilotAI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment threadsrc/coreclr/vm/prestub.cpp Outdated
Comment threadsrc/coreclr/vm/prestub.cpp
CopilotAI review requested due to automatic review settings February 27, 2026 03:32

CopilotAI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
CopilotAI review requested due to automatic review settings February 27, 2026 08:13
@radekdoulik
radekdoulik enabled auto-merge (squash) February 27, 2026 08:13

CopilotAI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment threadsrc/coreclr/vm/prestub.cpp Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
CopilotAI review requested due to automatic review settings February 27, 2026 08:25

CopilotAI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment threadsrc/coreclr/interpreter/compiler.cpp
@radekdoulik
radekdoulik merged commit c30eec2 into dotnet:mainFeb 27, 2026
107 of 109 checks passed
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Mar 30, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasmWebAssembly architecturearea-VM-coreclr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[wasm][coreclr] Attempt to access method System.Delegate.DelegateConstruct results in exception

3 participants

@radekdoulik@jkotas