Skip to content

wasmparser reports incorrect arity for end instruction for if with no else? #2235

@fitzgen

Description

@fitzgen

Given the following Wasm module, wasmparser reports the if's end as popping 2 values and pushing 2 values, but I think it should be popping and pushing 1 value, no?

                (module
                    (func (export "f") (param i64 i32) (result i64)
                        (local.get 0)
                        (local.get 1)
                        ;; If with no else. Same number of params and results.
                        (if (param i64) (result i64)
                            (then
                                (drop)
                                (i64.const -1)
                            )
                        )
                    )
                )

cc @keithw

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