Narrow Mono AOT typeload error cleanup - #129695
Closed
vitek-karas wants to merge 2 commits into
Closed
Conversation
Only clear the expected recoverable field-resolution metadata errors after lowering the failure into runtime throw IR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR narrows Mono AOT typeload-error cleanup in the field-resolution recovery path by consuming additional expected/recoverable metadata errors after the failure is lowered into runtime-throw IR, preventing later inlining assertions from seeing a live cfg->error.
Changes:
- Expand the “recoverable metadata error” cleanup to also clear
MONO_ERROR_MISSING_FIELD(in addition toMONO_ERROR_BAD_IMAGE) afterHANDLE_TYPELOAD_ERRORin the AOT-only field-resolution failure path. - Add an explanatory comment describing why
cfg->errormust be consumed to avoidinline_method()’smono_error_assert_ok (cfg->error)assertion later in compilation.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
@BrzVlad could you please take a look before I bring it up for servicing? |
This was referenced Jun 22, 2026
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.
Summary
MissingField/BadImagemetadata errors after lowering Mono AOT field-resolution failures into runtime throw IRsrc/mono/mono/mini/iltests.ilthat covers a generic missing-field access followed by a later accepted inline in the same compiled methodTesting
./build.sh mono -os iossimulator -arch arm64 -c Release -rf monoinline_method()src/mono/mono/mini/iltests.il:mono iltests.exe --run-only missing_field_then_inlinemono --aot=full,static iltests.exeThis doesn't add a CI runnable test as that would require lot of infra which feels a bit too much for servicing change. (I did try, and hitting this is not simple especially with end-to-end test)
Fixes #129613.