Repository navigation
Fix EnC static field address cDAC API - #131443
Merged
Merged
Conversation
|
Azure Pipelines: Successfully started running 5 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. |
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
1 similar comment
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the cDAC RuntimeMutableTypeSystem contract to return the correct storage address for EnC-added static fields, matching CoreCLR’s EnCAddedStaticField::GetFieldData() semantics for primitive vs. managed (class / valuetype) fields.
Changes:
- Update
GetEnCStaticFieldDataAddressto return the inline storage address for primitives, and to return the indirect (GC-tracked) storage address forClass/ValueTypefields by reading the pointer stored in theFieldDataslot. - Expand unit test coverage to validate both primitive and managed (class/valuetype) behaviors.
- Update the contract design doc and descriptor-meaning text to document the corrected
EnCAddedStaticField.FieldDatainterpretation.
Show a summary per file
| File | Description |
|---|---|
| src/native/managed/cdac/tests/UnitTests/RuntimeMutableTypeSystemTests.cs | Splits/enhances tests to cover primitive vs. managed EnC static field storage behavior using mocked IRuntimeTypeSystem.GetFieldDescType. |
| src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/RuntimeMutableTypeSystem_1.cs | Fixes GetEnCStaticFieldDataAddress to mirror CoreCLR indirection for Class/ValueType static EnC fields. |
| docs/design/datacontracts/RuntimeMutableTypeSystem.md | Updates the spec text and algorithm to reflect the new indirection behavior for managed static fields. |
| docs/design/datacontracts/data-descriptor-meanings.json | Updates the descriptor meaning for EnCAddedStaticField.FieldData to match the clarified semantics. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 0
noahfalk
approved these changes
Jul 27, 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.
Fix GetEnCStaticFieldDataAddress to match EnCAddedStaticField::GetFieldData w.r.t value and class types.