Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Binary format of br_on_cast #173

Closed
Closed
@kripken

Description

@kripken

I am having trouble implementing it. I see the prototype doc says it has 3 immediates, the index of the block it targets, and two heap types. Given this:

(br_on_cast $out $B (ref.null $A) (rtt.canon $B))

Binaryen will emit this:

fb 42 00 02 00

fb is the GC prefix, 42 is the code for br_on_cast, and then the immediates come: 00 for the block target (it targets the block it is immediately in), then 02 for the first heap type, and then 00 for the second heap type it is trying to cast it to. But this last immediate errors in wasp with Unknown reference type: 0 and in v8 with block type index 0 is not a signature definition.

Should there be something else than a heap type for that immediate?

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