[PR #667] [MERGED] fix(dotnet): preserve leading Unicode content in metadata strings #2150

Closed
opened 2026-10-16 21:14:56 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/667
Author: @rudycelekli
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/6/2026
Merged by: @morluto

Base: main ← Head: fix/rea-managed-unicode-content-20261006


📝 Commits (1)

  • 5eda668 fix(dotnet): preserve leading Unicode content in metadata strings

📊 Changes

5 files changed (+71 additions, -2 deletions)

View changed files

📝 src/dotnet/ManagedArtifactInspector.test.ts (+16 -0)
📝 src/dotnet/ManagedMemberInspector.test.ts (+19 -0)
📝 src/dotnet/ManagedMetadataHeaps.ts (+1 -1)
📝 src/dotnet/ManagedMetadataInventoryRows.ts (+1 -1)
📝 tests/boundary/providers/managed/managedStaticProvider.test.ts (+34 -0)

📄 Description

Summary

Preserve a leading U+FEFF when decoding individual ECMA-335 metadata strings and the fixed string in a TargetFrameworkAttribute. These byte ranges contain string data, rather than complete text documents with a byte-order marker. The default TextDecoder handling silently removes that first character.

The regression starts with a source-owned PE/CLI file whose type, method, field, reference and framework strings contain U+FEFF. Before the fix, inspection changes those names. With ignoreBOM: true, inspection preserves their exact content; ordinary names and interior U+FEFF remain intact.

Verification

  • Before: both added source regressions failed; the existing 12 tests passed.
  • After: npm run test:focused -- src/dotnet/ManagedMemberInspector.test.ts src/dotnet/ManagedArtifactInspector.test.ts tests/boundary/providers/managed/managedStaticProvider.test.ts — 17 tests passed. The boundary regression writes an owned PE, resolves the filesystem target, invokes ManagedStaticProvider, and checks the advertised result schemas.
  • npm run check — all five required tasks passed.
  • npm run verify:managed — 11 source-owned static conformance scenarios passed. The optional operator manifest and ILSpy oracle were not configured; this does not claim CLR execution or decompiler equivalence.
  • No contract or generated metadata changes. No real Hopper or Ghidra verification was performed: neither provider is changed.

AI assistance was used to investigate, implement, and test this change. The patch and reproductions were reviewed before publication.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/667 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/6/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/rea-managed-unicode-content-20261006` --- ### 📝 Commits (1) - [`5eda668`](https://github.com/morluto/rea/commit/5eda668f82cb555bf9e1327fd371259eeca7c632) fix(dotnet): preserve leading Unicode content in metadata strings ### 📊 Changes **5 files changed** (+71 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/dotnet/ManagedArtifactInspector.test.ts` (+16 -0) 📝 `src/dotnet/ManagedMemberInspector.test.ts` (+19 -0) 📝 `src/dotnet/ManagedMetadataHeaps.ts` (+1 -1) 📝 `src/dotnet/ManagedMetadataInventoryRows.ts` (+1 -1) 📝 `tests/boundary/providers/managed/managedStaticProvider.test.ts` (+34 -0) </details> ### 📄 Description ## Summary Preserve a leading U+FEFF when decoding individual ECMA-335 metadata strings and the fixed string in a TargetFrameworkAttribute. These byte ranges contain string data, rather than complete text documents with a byte-order marker. The default TextDecoder handling silently removes that first character. The regression starts with a source-owned PE/CLI file whose type, method, field, reference and framework strings contain U+FEFF. Before the fix, inspection changes those names. With `ignoreBOM: true`, inspection preserves their exact content; ordinary names and interior U+FEFF remain intact. ## Verification - Before: both added source regressions failed; the existing 12 tests passed. - After: `npm run test:focused -- src/dotnet/ManagedMemberInspector.test.ts src/dotnet/ManagedArtifactInspector.test.ts tests/boundary/providers/managed/managedStaticProvider.test.ts` — 17 tests passed. The boundary regression writes an owned PE, resolves the filesystem target, invokes ManagedStaticProvider, and checks the advertised result schemas. - `npm run check` — all five required tasks passed. - `npm run verify:managed` — 11 source-owned static conformance scenarios passed. The optional operator manifest and ILSpy oracle were not configured; this does not claim CLR execution or decompiler equivalence. - No contract or generated metadata changes. No real Hopper or Ghidra verification was performed: neither provider is changed. AI assistance was used to investigate, implement, and test this change. The patch and reproductions were reviewed before publication. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:14:56 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2150
No description provided.