Skip to content

fix(core): preserve asm-op mappings in MastForest::merge#2958

Open
KitaroMoha563 wants to merge 5 commits into0xMiden:nextfrom
KitaroMoha563:fix/core-mastforest-merge-asm-op-mappings
Open

fix(core): preserve asm-op mappings in MastForest::merge#2958
KitaroMoha563 wants to merge 5 commits into0xMiden:nextfrom
KitaroMoha563:fix/core-mastforest-merge-asm-op-mappings

Conversation

@KitaroMoha563
Copy link
Copy Markdown
Contributor

Preserve and remap AssemblyOp source mappings during MastForest::merge, preventing debug source locations from being lost after forest deduplication and link-time merge.

Comment thread core/src/mast/merger/mod.rs Outdated
Copy link
Copy Markdown
Collaborator

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

Thanks! The underlying bug is real: MastForest::merge was losing AssemblyOp source mappings during dedup, which breaks debug/source-location fidelity after linking.

However, the new logic still keeps the first mapping for a deduplicated node. That means results still depend on merge order when both duplicates already have asm-op mappings and one is richer than the other. In that case, source info can still be lost.

relates to #2929

Comment thread core/src/mast/merger/mod.rs Outdated
Comment thread core/src/mast/merger/mod.rs Outdated
@0xMiden 0xMiden deleted a comment from github-actions Bot Apr 7, 2026
Comment thread core/src/mast/merger/mod.rs
Copy link
Copy Markdown
Collaborator

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the contribution!

@huitseeker huitseeker requested a review from bitwalker April 10, 2026 07:03
@0xMiden 0xMiden deleted a comment from github-actions Bot Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants