Skip to content

Fix EnC static field address cDAC API - #131443

Merged
rcj1 merged 1 commit into
dotnet:mainfrom
rcj1:fix-enc-test
Jul 28, 2026
Merged

rcj1 merged 1 commit into
dotnet:mainfrom
rcj1:fix-enc-test

Conversation

@rcj1

@rcj1 rcj1 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Fix GetEnCStaticFieldDataAddress to match EnCAddedStaticField::GetFieldData w.r.t value and class types.

@azure-pipelines

Copy link
Copy Markdown
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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

1 similar comment
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 GetEnCStaticFieldDataAddress to return the inline storage address for primitives, and to return the indirect (GC-tracked) storage address for Class / ValueType fields by reading the pointer stored in the FieldData slot.
  • 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.FieldData interpretation.
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

@rcj1
rcj1 enabled auto-merge (squash) July 27, 2026 23:26
@rcj1
rcj1 merged commit f8cf526 into dotnet:main Jul 28, 2026
84 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Jul 28, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants