Skip to content

--no-check produces malformed module #2629

@Janrupf

Description

@Janrupf

This is effectively moved from WebAssembly/testsuite#132 to here.

In short, compiling the following module with wat2wasm and --no-check:

(module 
  (func (export "test") 
    (data.drop 0))) 

leads to a WASM module that contains no data count section. According to the official specification, if a module uses data.drop or memory.init, it needs to contain a data count section.

Arguably this entire situation is bogus simply because we need to compile with --no-check for this to even compile. Interestingly enough though this seems to be only situation where --no-check leads a malformed and not an invalid module. In this case that causes some confusion when strictly interpreting the testsuite test cases w.r.t. if a module should fail to parse or fail to validate.

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