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
When an included file reaches EOF with an active #ifdef, its per-source count is positive, but this only pops _includeSourceStack; the corresponding entries remain in _activeIfDefBlocks. If the including file is itself inside an active block, its next #else or #endif then pops the stale included-file entry and corrupts the conditional state, producing spurious diagnostics. Remove the active entries belonging to the popped source before continuing.
[!NOTE] This comment was generated by GitHub Copilot.
Qualify the process-isolation summary for managed ILASM markers
This table now says that ManagedIlasmRoundTripIncompatible always requires process isolation, but the preceding section explicitly documents that shared-library projects use the merged-runner marker and do not need it. Please qualify this row for runnable/per-process tests (or otherwise reconcile the table) so the documented configuration guidance is not contradictory.
Clarified that shared-library projects do not need process isolation for the property related to disabling tests. Added a note that these workarounds are temporary until bugs are fixed.
Explain the coupling between the custom PE builder's COR header offset and System.Reflection.Metadata's managed text layout.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 806a996a-9fcc-42b7-a902-cac954582b24
Match native ilasm's observable InitLocals behavior for short localloc methods whose ildasm text cannot otherwise represent the original header flag.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 806a996a-9fcc-42b7-a902-cac954582b24
Runtime test assets are built architecture-neutral, so emit the temporary x86 OOM exclusions without TargetArchitecture conditions.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 806a996a-9fcc-42b7-a902-cac954582b24
The new direct SQSTRING alternative is not handled by GrammarVisitor.VisitDottedName: that method only special-cases DOTTEDNAME and otherwise joins dottedNamePart() values. A whole quoted name such as 'Contoso.Tools..ctor' therefore produces an empty name, so the added QuotedTypeName_WithConsecutiveDots_SplitsAtLastDot case fails and valid quoted type names are emitted incorrectly. Add an explicit context.SQSTRING() path that parses the quoted token.
Managed ilasm exceeds practical memory limits while assembling HugeField1, so emit the same unconditional marker used by the other OOM cases.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 806a996a-9fcc-42b7-a902-cac954582b24
The reason will be displayed to describe this comment to others. Learn more.
Looks like HugeField2 needs skipping too (failed in CI)
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.