Skip to content

wasp encodes element sections differently than binaryen [typed function references] #63

@dbezhetskov

Description

@dbezhetskov

The example func_ref_o.wat:

(module
  (func (export "main") (result i32)
    (call_ref (i32.const 10)
              (ref.func $foo)
    )
  )
  (func $foo (param $x i32) (result i32)
    (i32.add (local.get $x)
             (i32.const 19))
  )
  (elem declare funcref (ref.func $foo))
)

wasp wat2wasm --enable-function-references:

Contents of section element:
0000025: 0107 7001 d201 0b                        ..p....

binaryen wasm-as --enable-reference-types:

Contents of section element:
0000025: 0103 0001 01                             .....

wasp encodes element section as vec(expr) and binaryen encodes it as vec(func_idx), according to the https://github.com/WebAssembly/function-references/blob/master/proposals/function-references/Overview.md there is no any evidence that vec(expr) should be used.

Is it a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions