Skip to content

Fix handling invalid type map states#125870

Merged
jkoritzinsky merged 1 commit intodotnet:mainfrom
jkoritzinsky:typemap-r2r-invalid
Mar 21, 2026
Merged

Fix handling invalid type map states#125870
jkoritzinsky merged 1 commit intodotnet:mainfrom
jkoritzinsky:typemap-r2r-invalid

Conversation

@jkoritzinsky
Copy link
Copy Markdown
Member

Fixes #125718

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 a ReadyToRun (CrossGen2) type map encoding edge case where “invalid type map state” entries were emitted in a shape that the CoreCLR runtime parser can’t consume, leading to malformed fixup index assertions when reading precached type maps.

Changes:

  • Emit the type map group type fixup reference even when the type map is marked invalid (state = 0).
  • Encode invalid entries as a tuple (groupTypeFixup, state) instead of emitting just state.

Reviewed changes

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

File Description
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunProxyTypeMapNode.cs Ensures invalid proxy type map entries still begin with the group type fixup reference, matching runtime parsing expectations.
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunExternalTypeMapNode.cs Ensures invalid external type map entries still begin with the group type fixup reference, matching runtime parsing expectations.

@jkoritzinsky jkoritzinsky merged commit f01e41d into dotnet:main Mar 21, 2026
105 of 107 checks passed
@github-project-automation github-project-automation Bot moved this to Done in AppModel Mar 21, 2026
@jkoritzinsky jkoritzinsky deleted the typemap-r2r-invalid branch March 21, 2026 02:31
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Assert failure: !"Malformed type map fixup index out of bounds"

3 participants