Repository navigation
fix(managed): resolve member ownership through pointer tables - #1886
Merged
morluto merged 1 commit intoOct 11, 2026
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
3 tasks done
Owner
|
Thanks, @chqcjq, for resolving FieldPtr and MethodPtr list positions back to physical member rows while keeping the original metadata tokens and partial facts intact. The independent PEReader comparison gives the pointer-table case a useful reference point. Welcome to REA. |
This was referenced Oct 11, 2026
Closed
2 tasks done
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Resolve declaring-type ownership through
FieldPtrandMethodPtrfor unoptimized managed metadata. Physical Field/MethodDef tokens remain unchanged, while member owners and local custom-attribute constructor types follow the metadata's pointer ordering.This is the pre-existing defect identified in the #1706 review, which the author explicitly deferred to a separate shared-owner fix. It does not implement type selection or the separate cursor-budget work in #1878.
Problem and expected behavior
REA admits
#-metadata but compares physical Field/MethodDef row numbers directly against TypeDef list positions. Those coordinates differ when a pointer table reorders the definitions.A 4 KiB source-owned fixture has
<Module>,Fixture.A,Fixture.B, two fields and two methods, and pointer rows[2,1]. On basefb94d9dd, the first physical field/method is incorrectly attributed to A and the second to B, with complete coverage. A custom attribute whose constructor is physical MethodDef row 1 also receives the wrong type name.Expected: physical row 1 belongs to B and row 2 to A; their tokens remain
0x04000001/02and0x06000001/02. Microsoft'sSystem.Reflection.Metadata/PEReaderindependently produced that ownership for the same fixture without loading or executing the assembly.Change and scope
The implementation changes the shared interpretation, rather than patching a selected-type filter. Existing direct-list behavior and malformed TypeDef first-match behavior remain covered. No cursor/CIL/string/projection budget was removed or increased.
Contract and boundary impact
src/dotnet.Evidence and regression coverage
#~controls passed.For evidence-bearing changes:
Validation performed
On Windows x64 with the pinned Node 24.18.0 / npm 11.16.0:
npm run test:local -- <all 10 src/dotnet/*.test.ts files>— 158 passed, no failures or skips.npm run test:focused -- tests/acceptance/managedMemberPointers.test.ts— 1 passed, compiled CLI/stdio MCP parity.npm run verify:managed— passed, 11 portable conformance scenarios. Optional operator-local manifest and ILSpy oracle were not configured and remain explicitly unsupported in the report.npm run check— passed; existing and reported lint warnings remain, no errors.npm run docs:check— passed.npm run verify:test-discovery— all 845 files discovered exactly once.git diff --check— passed.codex review --base origin/mainwith invocation-only compatibility overrides for two unsupported feature-table settings — completed with no actionable regressions reported. Its supplementary tests used the host-default Node 24.9.0; the authoritative test/gate results listed above were separately run on pinned Node 24.18.0.Compatibility, safety, and release
Review checklist