Skip to content

Fix marshaller signature parameter index handling#130238

Draft
MichalStrehovsky with Copilot wants to merge 4 commits into
mainfrom
copilot/add-regression-test-and-fix-bug
Draft

Fix marshaller signature parameter index handling#130238
MichalStrehovsky with Copilot wants to merge 4 commits into
mainfrom
copilot/add-regression-test-and-fix-bug

Conversation

Copilot AI commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

A marshalling check used the sparse parameter metadata cursor where it needed the signature parameter index. This caused copy-constructor custom modifiers to be evaluated against the wrong parameter when metadata was missing or sparse.

  • Corrected marshaller creation to pass the signature index for custom modifier lookup.
  • Applied the fix to both shared marshalling and P/Invoke IL stub paths.
  • Added TypeSystem regression coverage for a copy-constructed parameter with empty parameter metadata.

Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@MichalStrehovsky

Copy link
Copy Markdown
Member

@copilot delete the unit test added in this PR. instead add a functional test under src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/

Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot July 7, 2026 00:04
Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot July 7, 2026 00:06
Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot July 7, 2026 00:08

Copilot AI commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot delete the unit test added in this PR. instead add a functional test under src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/

Addressed in a7e59b3. The TypeSystem unit test was removed and the regression coverage was moved into src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants