Skip to content

ConstraintAnalysis: Infer non-nullability from trapping operations - #9434

Open
kripken wants to merge 31 commits into
WebAssembly:mainfrom
kripken:ca.gc.2mine
Open

kripken wants to merge 31 commits into
WebAssembly:mainfrom
kripken:ca.gc.2mine

Conversation

@kripken

@kripken kripken commented Nov 26, 2026

Copy link
Copy Markdown
Member

Consider

(struct.get
  (local.get $x)
)
(ref.is_null
  (local.get $x)
)

The struct.get traps if x is null, so we can infer it is not null
afterwards, or we wouldn't get there.

@github-actions
github-actions Bot requested a review from tlively November 26, 2026 00:55
}

return;
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@aheejin You suggested an early return for the LocalSet case here, but I think after this refactor it would break the symmetry of the new code after it... so I left it as is. But open to suggestions here.

This branch has not been deployed

No deployments
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