Repository navigation
Validate targets of generic lookup in the scanner - #130110
Merged
Merged
Conversation
Fixes dotnet#130028. This way we can catch types that don't load at a spot where we can still recover (generate a throwing body). The repro already works correctly in Debug builds because we make this callout for all tokens RyuJIT resolves from IL.
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens NativeAOT IL scanning so that invalid generic-lookup targets (types/methods that can’t be loaded) are detected during scanning, where the scanner can still recover by generating a throwing fallback body, rather than failing later in dependency analysis.
Changes:
- Add loadability validation for
TypeDesc/MethodDescarguments passed to the scanner’s generic lookup helper path. - Add a NativeAOT smoke test regression that expects a
TypeLoadExceptionat runtime when invoking a method that would create an array of an oversized inline-array-based value type.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/tests/nativeaot/SmokeTests/UnitTests/Generics.cs | Adds a regression test (Test130028Regression) and wires it into the smoke test runner. |
| src/coreclr/tools/aot/ILCompiler.Compiler/IL/ILImporter.Scanner.cs | Validates loadability of type/method lookup targets before computing helper-based generic lookups. |
jkotas
approved these changes
Jul 2, 2026
eiriktsarpalis
pushed a commit
that referenced
this pull request
Jul 15, 2026
Fixes #130028. This way we can catch types that don't load at a spot where we can still recover (generate a throwing body). The repro already works correctly in Debug builds because we make this callout for all tokens RyuJIT resolves from IL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #130028.
This way we can catch types that don't load at a spot where we can still recover (generate a throwing body). The repro already works correctly in Debug builds because we make this callout for all tokens RyuJIT resolves from IL.