Skip to content

Error adding data segmentsΒ #221

@chenyan2002

Description

@chenyan2002

Describe the Bug

Adding a new data segment produces bad Wasm binary.

Steps to Reproduce

    let mut m = Module::with_config(ModuleConfig::new());
    m.data.add(DataKind::Passive, vec![1,2,3,4]);
    m.emit_wasm_file("out.wasm").unwrap();

Running wasm2wat out.wasm -o out.wat gets the following error

000000e: error: invalid section code: 12

Expected Behavior

wasm2wat should produce no error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions