Skip to content

P/Invoke transient IL regression fixes#127400

Open
jkoritzinsky wants to merge 6 commits intodotnet:mainfrom
jkoritzinsky:pinvoke-nostub-fixes
Open

P/Invoke transient IL regression fixes#127400
jkoritzinsky wants to merge 6 commits intodotnet:mainfrom
jkoritzinsky:pinvoke-nostub-fixes

Conversation

@jkoritzinsky
Copy link
Copy Markdown
Member

Fixes #127231
Fixes #127209

@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes CoreCLR P/Invoke regressions related to transient IL by correcting x86 stack-argument sizing behavior during stub generation and adjusting PInvokeImportWorker to handle additional runtime call paths / GC modes without contract violations.

Changes:

  • Ensure x86 stack argument size computation initializes per-argument native sizes via MarshalInfo::SetupArgumentSizes().
  • Update PInvokeImportWorker to allow cooperative-mode callers for SuppressGCTransition scenarios and avoid resolving targets when already resolved.
  • Limit managed exception dispatcher / unwind handler installation to the resolution path.

Comment thread src/coreclr/vm/dllimport.cpp Outdated
Comment thread src/coreclr/vm/dllimport.cpp Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 24, 2026 20:09
Comment thread src/coreclr/vm/dllimport.cpp Outdated
Comment thread src/coreclr/vm/dllimport.cpp Outdated
Comment thread src/coreclr/vm/dllimport.cpp Outdated
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 1 out of 1 changed files in this pull request and generated no new comments.

Comment thread src/coreclr/vm/dllimport.cpp
Comment thread src/coreclr/vm/dllimport.cpp Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

CONTRACT VIOLATION by PInvokeImportWorker Test failure: global::GenericsTest.TestVector128C()

3 participants