Skip to content

fix(dotnet): keep non-CIL method implementations unknown - #675

Closed
rudycelekli wants to merge 2 commits into
morluto:mainfrom
rudycelekli:fix/rea-managed-non-cil-methods-20261006
Closed

rudycelekli wants to merge 2 commits into
morluto:mainfrom
rudycelekli:fix/rea-managed-non-cil-methods-20261006

Conversation

@rudycelekli

@rudycelekli rudycelekli commented Oct 6, 2026 •

Copy link
Copy Markdown

Summary

Honor MethodDef implementation metadata before interpreting a nonzero RVA as managed CIL. Native, runtime, unmanaged, and P/Invoke implementations do not establish that the bytes at that address have an admitted CIL representation.

The current reader can produce managed instructions, IL hashes and call/field edges from unrelated implementation bytes that happen to resemble a tiny IL header. This change retains the original RVA and reports partial body coverage with an explicit CIL-unavailable reason. It emits no invented managed anchors. Zero-RVA bodies remain proven absent, and ordinary managed IL decoding is unchanged.

Verification

  • Before: all four added implementation-flag cases failed because inspection reported a complete CIL body.
  • npm run test:focused -- src/dotnet/ManagedMemberInspector.test.ts src/dotnet/ManagedCilDecoding.test.ts src/dotnet/ManagedNativeBoundaryInspector.test.ts tests/boundary/providers/managed/managedStaticProvider.test.ts — 24 tests passed.
  • The filesystem regression writes a source-owned PE/CLI fixture, resolves its target, and invokes the actual ManagedStaticProvider/result schemas. It checks managed CIL, non-CIL bytes at a retained RVA, and a zero-RVA absence control.
  • npm run check — all five required tasks passed.
  • npm run verify:managed — 11 static source-owned conformance scenarios passed; optional operator manifest and ILSpy oracle were not configured.
  • No real native method execution, CLR execution, Hopper or Ghidra verification is claimed. No advertised contract or generated metadata is changed.

AI assistance was used for investigation, implementation and testing. The patch was independently reviewed before publication.

CI follow-up

The package consumer fixture previously combined a P/Invoke flag with a CIL body on its only Main method, then reused that impossible combination as a reconstruction input. Both package integration lanes correctly exposed this fixture drift once this fix stopped fabricating CIL hashes. The fixture now has an ordinary CIL Main and a separate zero-RVA P/Invoke declaration, with its ImplMap pointing at the second method. All existing managed reconstruction, native boundary, native verification and application graph checks remain exercised.

On repair head d0af4df69bf3d6c67defbe16fae616067969091f, npm run verify:package completed the installed-tarball CLI/MCP consumer roundtrip successfully on this macOS host, and all five npm run check tasks passed. The repaired head subsequently completed all 18 hosted checks successfully, including both Ubuntu and macOS package integration lanes.

@morluto morluto left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Approve: non-CIL impl (codeType/managed bits, PInvokeImpl) now returns partial with retained RVA instead of fabricating IL/hashes/edges; RVA-zero absent preserved. Unit + provider tests across CIL/partial/absent, plus honest packaged-fixture repair. Checks green.

@morluto

morluto commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Superseded by #705, which cherry-picks this change (plus 13 sibling fixes) onto current main with conflict resolution and regenerated catalogs. Closing to keep one reviewable merge unit.

@morluto morluto closed this Oct 6, 2026
@morluto

morluto commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Thanks, @rudycelekli, for your work on “fix(dotnet): keep non-CIL method implementations unknown.” I appreciate your contribution to REA.

@morluto morluto added bug Something isn't working area: build Build, CI, packaging, and publishing labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, packaging, and publishing bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants