Skip to content

Comments

Fix regression introduced in #123925#124724

Closed
jgh07 wants to merge 1 commit intodotnet:mainfrom
jgh07:fix-123925
Closed

Fix regression introduced in #123925#124724
jgh07 wants to merge 1 commit intodotnet:mainfrom
jgh07:fix-123925

Conversation

@jgh07
Copy link
Contributor

@jgh07 jgh07 commented Feb 22, 2026

#123925 breaks the functionality introduced in #119935.

This PR fixes this issue and adds an appropriate test. I decided to also address the comments in #124537 here.

Copilot AI review requested due to automatic review settings February 22, 2026 12:50
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Feb 22, 2026
@dotnet-policy-service
Copy link
Contributor

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

Copy link
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 a regression in PersistedAssemblyBuilder signature emission that broke persisting function-pointer signatures with custom modifiers (modreq/modopt), and adds a regression test to cover the scenario.

Changes:

  • Ensure function-pointer return/parameter custom modifiers are written when encoding function-pointer signatures.
  • Extend SaveFunctionPointerFields coverage to include an unmanaged function pointer with multiple calling conventions (including SuppressGCTransition).
  • Update test utility helper nullability annotations for modifier/calling-convention arrays.

Reviewed changes

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

File Description
src/libraries/System.Reflection.Emit/tests/Utilities.cs Updates helper types used by tests to accept nullable arrays for conventions/modifiers.
src/libraries/System.Reflection.Emit/tests/PersistedAssemblyBuilder/AssemblySaveTypeBuilderTests.cs Adds a new regression assertion via a delegate* unmanaged[Fastcall, SuppressGCTransition]<void> field persisted to disk and reloaded.
src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/SignatureHelper.cs Writes required/optional custom modifiers for function-pointer return/parameter types during signature encoding.

@jgh07
Copy link
Contributor Author

jgh07 commented Feb 22, 2026

Actually, it looks like this is only an issue in #123819, I'll add this commit there instead.

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

Labels

area-System.Reflection.Emit community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant