Skip to content

Fix validation error in wasm-reduce#8715

Open
tlively wants to merge 2 commits into
mainfrom
wasm-reduce-invalid
Open

Fix validation error in wasm-reduce#8715
tlively wants to merge 2 commits into
mainfrom
wasm-reduce-invalid

Conversation

@tlively
Copy link
Copy Markdown
Member

@tlively tlively commented May 15, 2026

When removing functions, wasm-reduce replaces calls to those functions using builder.replaceWithIdenticalType. That method can modify the input expression in-place to have a different types (e.g. replacing a reference with a null), so when the previous code read curr->type to set the type of the replacement block, it was possible to get a more refined type, leading to validation failures. Fix the bug by explicitly using the original type.

Fixes #8713.

When removing functions, wasm-reduce replaces calls to those functions using `builder.replaceWithIdenticalType`. That method can modify the input expression in-place to have a different types (e.g. replacing a reference with a null), so when the previous code read `curr->type` to set the type of the replacement block, it was possible to get a more refined type, leading to validation failures. Fix the bug by explicitly using the original type.
@tlively tlively requested a review from kripken May 15, 2026 22:57
@tlively tlively requested a review from a team as a code owner May 15, 2026 22:57
@kripken
Copy link
Copy Markdown
Member

kripken commented May 15, 2026

(confirmed as fixing my problem, thanks!)

@tlively tlively enabled auto-merge (squash) May 15, 2026 23:12
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.

wasm-reduce crash on WasmValidator

2 participants