Skip to content

Stack branch type checking of call_indirect #318

Closed
@binji

Description

@binji

Type checking of call_indirect on the stack branch is currently defined as:

  | CallIndirect x ->
    let FuncType (ins, out) = type_ c.types x in
    (ins @ [I32Type]) --> Stack out

Which means the table index comes last (i.e. is on the top of the stack), is that correct? This is inconsistent with the binary format 0xb where the function index is first. Though I've also noticed that this isn't specified in the binary format design docs: https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#basic-operators-described-here.

Is this also changing with binary_0xc, or is this a bug?

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