Skip to content

Reject yielding a value to the top of a loop #277

@sunfishcode

Description

@sunfishcode

The following code currently validates in the ml-proto interpreter:

(module (func (loop (br 0 (i32.const 0)))))

This isn't useful, because the (i32.const 0) value isn't actually used, since the branch is going to the top of a loop.

I propose that this be made a validation error, both to diagnose accidental use, and to reserve room for making branches to loop tops to be extended in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions