Skip to content

[spec] Preserve host function arguments on divergence - #2231

Merged
rossberg merged 1 commit into
WebAssembly:mainfrom
sanguineman:fix/hostfunc-div-preserve-args
Sep 1, 2026
Merged

[spec] Preserve host function arguments on divergence#2231
rossberg merged 1 commit into
WebAssembly:mainfrom
sanguineman:fix/hostfunc-div-preserve-args

Conversation

@sanguineman

@sanguineman sanguineman commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Previously, the reduction rule for host function divergence dropped the call arguments val^n from the resulting configuration.

스크린샷 2026-08-24 오후 1 30 08

According to the WebAssembly specificaiton, the post-conditions for executing host functions must match those in the execution rule for invoking host functions. However, a host function that takes one or more arguments, one reduction step by Step/call_ref-hostfunc-div removes val^n and leaves only (REF.FUNC_ADDR a) (CALL_REF yy). Neither host-function execution rule can then apply because the required operands are missing.

Fix

The updated rule preserves the complete configuration, making the divergence case as exact self-loop as intended.

@rossberg rossberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch, thanks!

@rossberg
rossberg merged commit 6dec345 into WebAssembly:main Sep 1, 2026
9 checks passed
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.

2 participants