You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🟡 Changes recommended
The CLI normalization refactor currently misclassifies value-taking options (using Option.Name vs aliases), and Options introduces a breaking public member rename that should be made compatible or internal.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Lite Findings: 1 · 1 · 1
New issues introduced by this change (3)
Severity
Finding
src/tools/ilasm/src/ilasm/NativeCommandLine.cs — optionsWithValues is populated with Option.Name (e.g. "output"), but later checked against…
src/tools/ilasm/src/ILAssembler/Options.cs — Options is a public type and this change replaces the existing public IsDll property with Dll.…
src/tools/ilasm/tests/ILAssembler.Tests/CommandLineTests.cs — ModernValueOptions currently includes option.Name in addition to prefixed aliases. In…
What changed in this PR
This PR significantly expands the managed ilasm test suite and adjusts the managed IL assembler, test infrastructure, and CI/configuration to support additional IL round-trip scenarios (including a new managed-ilasm roundtrip), while fixing multiple metadata/PE emission and parsing edge cases uncovered by the added coverage.
Changes:
Add broad ILAssembler unit test coverage across metadata emission (typedefs/typerefs/exports/resources/events/properties/fields), parser robustness, preprocessor integration, and options/CLI behavior.
Update managed ilasm implementation to improve correctness/compatibility for opcode parsing, vararg/signature handling, PrivateScope naming, PE export/vtable fixup emission, and error-tolerant output behavior.
Extend CoreCLR test infrastructure/CI to support managedilasmroundtrip and introduce opt-out markers (ManagedIlasmRoundTripIncompatible) with accompanying documentation.
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🟡 Changes recommended
The new fat-header forcing logic in EntityRegistry can cause .maxstack-only methods (without .zeroinit) to emit InitLocals, altering semantics/metadata in a way that should be corrected or explicitly justified and locked in with tests.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Lite Findings: 2
New issues introduced by this change (1)
Severity
Finding
src/tools/ilasm/src/ILAssembler/EntityRegistry.cs — forceFatHeader triggers when methodDef.MaxStack < 8 (i.e., .maxstack was explicitly…
Pre-existing issues (1)
Severity
Finding
src/tools/ilasm/src/ILAssembler/Options.cs — Options is a public type and this change replaces the existing public IsDll property with Dll.… View comment
Issues resolved since last review (2)
Severity
Finding
src/tools/ilasm/tests/ILAssembler.Tests/CommandLineTests.cs — ModernValueOptions currently includes option.Name in addition to prefixed aliases. In… View resolved comment
src/tools/ilasm/src/ilasm/NativeCommandLine.cs — optionsWithValues is populated with Option.Name (e.g. "output"), but later checked against… View resolved comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🟡 Changes recommended
There are correctness issues in newly modified code paths (notably CLI normalization validation and method-body header emission) that can contradict the PR’s own tests/expected behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Lite Findings: 4
New issues introduced by this change (2)
Severity
Finding
src/tools/ilasm/src/ILAssembler/EntityRegistry.cs — The fallback body emission also forces InitLocals when forceFatHeader is true. That can change…
src/tools/ilasm/src/ilasm/NativeCommandLine.cs — -O:false / -g:true / -q:true should be treated as valid modern short-option forms (the unit…
Pre-existing issues (2)
Severity
Finding
src/tools/ilasm/src/ILAssembler/EntityRegistry.cs — forceFatHeader triggers when methodDef.MaxStack < 8 (i.e., .maxstack was explicitly… View comment
src/tools/ilasm/src/ILAssembler/Options.cs — Options is a public type and this change replaces the existing public IsDll property with Dll.… View comment
When forceFatHeader is true, this code forces the InitLocals flag on even if the original IL didn’t request .locals init. That changes emitted method-body semantics/metadata; forcing a fat header should not require changing the InitLocals bit (you already pass hasDynamicStackAllocation || forceFatHeader to avoid a tiny header).
This fallback path forces InitLocals when forceFatHeader is true, which can change the emitted method-body header semantics (even for methods that didn’t specify .locals init). It should be possible to keep the original BodyAttributes and rely on hasDynamicStackAllocation || forceFatHeader to force a fat header when needed.
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🔵 Needs a closer look
It spans low-level PE/metadata emission, grammar/parser behavior, test-harness execution logic, and CI scenario expansion, which warrants human validation of compatibility and unintended behavioral changes.
Review tier: Lite Findings: 4
Pre-existing issues (4)
Severity
Finding
src/tools/ilasm/src/ilasm/NativeCommandLine.cs — -O:false / -g:true / -q:true should be treated as valid modern short-option forms (the unit… View comment
src/tools/ilasm/src/ILAssembler/EntityRegistry.cs — The fallback body emission also forces InitLocals when forceFatHeader is true. That can change… View comment
src/tools/ilasm/src/ILAssembler/EntityRegistry.cs — forceFatHeader triggers when methodDef.MaxStack < 8 (i.e., .maxstack was explicitly… View comment
src/tools/ilasm/src/ILAssembler/Options.cs — Options is a public type and this change replaces the existing public IsDll property with Dll.… View comment
GetPointerSize is also called while parsing ordinary .data label references, not just vtable exports (for example, GrammarVisitor.VisitDdItem), but this switch only accepts I386, AMD64, and ARM64. BuildImage explicitly treats IA64, LoongArch64, and RiscV64 as supported 64-bit PE machines, so a valid data-label reference with any of those Options.Machine values now throws UnreachableException instead of emitting an 8-byte fixup. Base the switch on GetEffectiveMachine(machine) and include the other supported 64-bit machines (or separate the export-only architecture validation from generic pointer sizing).
This only checks that one NestedClass row exists; it never verifies that the row actually associates Inner with Outer, so the test would pass if the emitter wrote the wrong enclosing type. Assert the declaring handle (for example, Assert.Equal(outerHandle, inner.GetDeclaringType())) to validate the behavior claimed by this test.
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
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.
Creating a new PR to replace #131509.