Skip to content

Fix binary location tracking of wrapped expressions - #8960

Open
sbc100 wants to merge 1 commit into
mainfrom
fix-try-location
Open

Fix binary location tracking of wrapped expressions#8960
sbc100 wants to merge 1 commit into
mainfrom
fix-try-location

Conversation

@sbc100

@sbc100 sbc100 commented Jul 31, 2026

Copy link
Copy Markdown
Member

Proposed AI solution for assertion failure in AddrExprMap::add introduced in #8862. I don't understand this code myself.

When maybeWrapForLabel creates a synthetic block around a Try or If expression, push is called on the synthetic block rather than the underlying expression. Update expressionLocations.end for the inner expression when closing its scope in visitEnd, and push synthetic wrapper blocks with pushSynthetic so they are not tracked as duplicate binary instructions.

Fixes assertion failure in `AddrExprMap::add` introduced in #8862.

When `maybeWrapForLabel` creates a synthetic block around a `Try` or
`If` expression, `push` is called on the synthetic block rather than the
underlying expression. Update `expressionLocations.end` for the inner
expression when closing its scope in `visitEnd`, and push synthetic
wrapper blocks with `pushSynthetic` so they are not tracked as duplicate
binary instructions.
@sbc100
sbc100 requested a review from a team as a code owner July 31, 2026 16:01
@sbc100
sbc100 requested review from aheejin and removed request for a team July 31, 2026 16:01
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.

1 participant