Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix IRBuilder on local operations outside of a function context #7183

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

kripken
Copy link
Member

@kripken kripken commented Dec 30, 2024

IRBuilder needs to check for a function context before doing
func->getLocalType(). Without such a check, a bad binary with a local
operation in say a global init would lead to a crash.

We don't actually need this for local.set, unlike tee and get, since
it doesn't call getLocalType, but this PR adds that too for consistency
of errors.

No other operations in IRBuilder were missing this check aside from
local operations.

Fixes #7178

@kripken kripken merged commit 059aa20 into WebAssembly:main Jan 6, 2025
13 checks passed
@kripken kripken deleted the global.local branch January 6, 2025 18:08
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.

[Crash] Segmentation Fault in wasm::HeapType::getKind() const ()
2 participants