Repository navigation
Managed ilasm: apply #line increments and validate sequence points - #136396
Merged
jkoritzinsky merged 16 commits intoOct 28, 2026
Merged
jkoritzinsky merged 16 commits into
jkoritzinsky merged 16 commits into
Conversation
Diagnose invalid Portable PDB source spans at their directives and preserve instructions in error-tolerant mode. Default omitted end columns to 0xffff while retaining hidden coordinates. Add boundary, source-location, and CLI regression coverage. Co-authored-by: Copilot App <[email protected]>
Advance both sequence-point line endpoints by physical source lines while preserving native quote-sensitive anchoring, document mappings, and hidden markers. Diagnose effective spans before narrowing or encoding them. Co-authored-by: Copilot App <[email protected]>
Check signed compressed start-line deltas across hidden points and document changes before recording points, retaining directive locations for diagnostics. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Default omitted end columns to 65534, matching the pinned Roslyn SRM compatibility workaround while preserving explicit columns and hidden markers. Co-authored-by: Copilot App <[email protected]>
|
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. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/jit-contrib |
14 tasks done
This was referenced Oct 24, 2026
Preserve source-mapping validation diagnostics alongside main's entrypoint diagnostics. Co-authored-by: Copilot App <[email protected]>
Assert exact compressed blob fields for legal maximum columns and lines so boundary regressions remain covered with the unmodified SDK reader used in CI. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A rejected sequence point incorrectly updates the deduplication state, causing a subsequent method to lose a valid first sequence point when using -debug -error.
1 open issue
What changed in this PR
Improves managed ilasm’s Portable PDB source mapping and validation, addressing items 1–3 of #135314.
Changes:
- Applies physical-line increments to both
#lineendpoints while preserving anchoring, include mappings, and hidden points. - Defaults omitted end columns to 65534 and diagnoses invalid coordinates or unencodable line deltas.
- Adds regression coverage and documents mapping rules and error-tolerant behavior.
| File | Description |
|---|---|
src/tools/ilasm/tests/ILAssembler.Tests/SequencePointTests.cs |
Tests mapping, coordinate limits, line deltas, and error recovery. |
src/tools/ilasm/tests/ILAssembler.Tests/CommandLineSequencePointTests.cs |
Tests output generation and instruction preservation with error tolerance. |
src/tools/ilasm/src/ILAssembler/Diagnostic.cs |
Adds sequence-point validation diagnostics. |
src/tools/ilasm/src/ILAssembler/CILParser.SemanticValues.MethodBodies.cs |
Records next-line anchoring for source directives. |
src/tools/ilasm/src/ILAssembler/Actions/GrammarActions.Debug.cs |
Implements increments, column defaults, and sequence-point validation. |
src/tools/ilasm/src/ILAssembler/Actions/GrammarActions.BuildImage.cs |
Corrects a comment about validation without PDB generation. |
src/tools/ilasm/README.md |
Documents source mapping and reader compatibility. |
src/tools/ilasm/MANAGED-ILASM-FIXES.md |
Records deliberate differences from native ilasm. |
Review effort: Balanced
Co-authored-by: Copilot App <[email protected]>
Update the cross-method span cache only after recording succeeds. Suppress repeated rejected attempts within their method and reset them on a new directive, preserving successful cross-method deduplication. Co-authored-by: Copilot App <[email protected]>
jkotas
approved these changes
Oct 27, 2026
jkoritzinsky
enabled auto-merge (squash)
October 27, 2026 21:04
Co-authored-by: Copilot App <[email protected]>
jkotas
approved these changes
Oct 27, 2026
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
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
Addresses items 1, 2 and 3 of #135314.
#lineincrements to both range endpoints using physical source lines, preserving native quote/form-sensitive anchoring, document mappings, include restoration, and hidden markers.ushort.MaxValue - 1) for compatibility with existing readers, with a pinned reference to the Roslyn workaround. Explicit columns remain unchanged.This branch is independently based on main, not stacked on the SRM correction. Ordinary omitted-column output is readable by the existing SDK; explicit legal maximum-column/high-line boundary coverage was run with the corrected SRM reader.
Validation already run
With the unmodified SDK reader (no custom host):
Result: 9 passed, 0 failed. The four omitted-column cases failed with
BadImageFormatExceptionbefore the compatibility revision.Full branch build/test using the separately built corrected SRM runtime:
Result: 5,456 passed, 0 failed, 3 existing skips. The unmodified reader still rejects the retained maximum-line boundary case; this does not affect the new ordinary default. No new test runs were performed for PR publication.
Note
This pull request description and code changes were prepared with GitHub Copilot assistance.