Skip to content

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

Merged
kripken merged 2 commits intoWebAssembly:mainfrom
kripken:global.local
Jan 6, 2025
Merged

Fix IRBuilder on local operations outside of a function context#7183
kripken merged 2 commits intoWebAssembly:mainfrom
kripken:global.local

Conversation

@kripken
Copy link
Copy Markdown
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
@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