Skip to content

Incorrect reduction rule for exiting a block normally #1605

@HMPerson1

Description

@HMPerson1

The spec currently lists a reduction rule:

\LABEL_n\{\instr^\ast\}~\val^n~\END &\stepto& \val^n
(i.e. there must be exactly n values on the stack)
This line was recently changed in #1564.

In the WebAssembly paper (Bringing the Web up to Speed with WebAssembly), this rule is listed as:
image
(i.e. leave stack untouched)
(This matches the copy of this rule in the runtime section (#1152) and in both formalizations of the spec (coq, isabelle))

My understanding is that the arity of a label describes the number of values that should be kept on the stack when breaking, not when exiting normally, since a loop reduces to a label whose arity is the loop's input value count.

This is the same conclusion reached in:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions