Skip to content

Preserve native ilasm property sentinel signatures - #137094

Merged
jkoritzinsky merged 2 commits into
dotnet:mainfrom
jkoritzinsky:dev/jkoritzinsky/ilasm-property-sentinel-compatibility
Nov 7, 2026
Merged

jkoritzinsky merged 2 commits into
dotnet:mainfrom
jkoritzinsky:dev/jkoritzinsky/ilasm-property-sentinel-compatibility

Conversation

@jkoritzinsky

Copy link
Copy Markdown
Member

Managed ILAsm counts standalone sentinel markers as property parameters. For .property int32 Goo(...), it emits 08 01 08 41 instead of native ILAsm's 08 00 08 41, causing the Visual Basic compiler to report BC30643.

Exclude standalone sentinels from the property parameter count and preserve sentinel bytes when rewriting local type handles. This retains native-supported malformed signatures rather than normalizing them. Add focused coverage for leading, middle, trailing, repeated, and sentinel-only signatures, plus forward local type references.

Validation on Windows:

  • .\build.cmd -subset tools.ilasm -test — passed; 5,795 tests passed, 3 skipped, 0 failed.
  • .\dotnet.cmd test src\tools\ilasm\tests\ILAssembler.Tests\ILAssembler.Tests.csproj --no-build --no-restore --filter 'FullyQualifiedName~PropertySignature_' --logger 'console;verbosity=minimal' — passed; all 9 focused cases passed.
  • Before the fix, the focused regression run reproduced incorrect parameter counts. A standalone consumer using the existing Roslyn Visual Basic compiler reproduced BC30643 with the packaged assembler and compiled without errors with both native ILAsm and the rebuilt managed assembler. The compared property blobs match.

Note

This pull request description and code changes were generated with GitHub Copilot.

Exclude sentinel markers from property parameter counts and preserve them while rewriting local type handles. Cover sentinel positions and forward local type references.

Co-authored-by: Copilot App <[email protected]>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
11 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, @dotnet/jit-contrib
See info in area-owners.md if you want to be subscribed.

Apply jkotas review suggestions to identify intentional preservation of malformed signatures.

Co-authored-by: Copilot App <[email protected]>
@jkoritzinsky
jkoritzinsky requested a review from jkotas November 6, 2026 19:48
@jkoritzinsky
jkoritzinsky enabled auto-merge (squash) November 6, 2026 20:15
@jkoritzinsky
jkoritzinsky merged commit 52747c3 into dotnet:main Nov 7, 2026
61 checks passed
@github-project-automation github-project-automation Bot moved this to Done in AppModel Nov 7, 2026
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants