Skip to content

Heap2Local: fix stale data cmpxchg bug#8856

Closed
tlively wants to merge 1 commit into
mainfrom
heap2local-track-locals-parents
Closed

Heap2Local: fix stale data cmpxchg bug#8856
tlively wants to merge 1 commit into
mainfrom
heap2local-track-locals-parents

Conversation

@tlively

@tlively tlively commented Jun 18, 2026

Copy link
Copy Markdown
Member

Fix a misoptimization bug where stale analyzer.parents and local graph data caused the ref.eq generated during the optimization of struct.atomic.rmw.cmpxchg to not be optimized. This led to a situation where the ref.eq would incorrectly evaluate to true when a null struct field value and a separate optimized allocations flowed into it.

Fix the problem by better tracking the new local sets and gets and parent relationships added during optimization. Keeping this information more up-to-date allows the escape analysis for subsequent allocations to find the fix the new ref.eq.

Fixes #8850.

Fix a misoptimization bug where stale `analyzer.parents` and local graph data caused the ref.eq generated during the optimization of struct.atomic.rmw.cmpxchg to not be optimized. This led to a situation where the ref.eq would incorrectly evaluate to true when a null struct field value and a separate optimized allocations flowed into it.

Fix the problem by better tracking the new local sets and gets and parent relationships added during optimization. Keeping this information more up-to-date allows the escape analysis for subsequent allocations to find the fix the new ref.eq.

Fixes #8850.
@tlively tlively requested a review from a team as a code owner June 18, 2026 00:35
@tlively tlively requested review from aheejin and removed request for a team June 18, 2026 00:35
@kripken

kripken commented Jun 18, 2026

Copy link
Copy Markdown
Member

I would prefer your #8857 to this, unless we have a strong reason against that PR?

@tlively

tlively commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

Nope, that sounds fine to me.

@tlively tlively closed this Jun 18, 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.

Heap2Local bug on cmpxchng

2 participants