Skip to content

Binary encoding for empty funcref segment may use wrong flags? #1269

@alexcrichton

Description

@alexcrichton

Given this *.wat:

(module
  (table 1 funcref)
  (elem (table 0) (i32.const 0) funcref))

this encodes as:

$ wat2wasm foo.wat --enable-all -o foo.wasm
$ wasm-objdump -x foo.wasm

foo.wasm:	file format wasm 0x1

Section Details:

Table[1]:
 - table[0] type=funcref initial=1
Elem[1]:
 - segment[0] flags=7 table=0 count=0
DataCount:
 - data count: 0

Here the element segment uses flags=7 but I think this one should more accurately use either 4 or 6 according to https://github.com/WebAssembly/bulk-memory-operations/blob/master/proposals/bulk-memory-operations/Overview.md#element-segments?

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