Skip to content

wasm-parser error when parsing memory.init command #1206

@WillConker

Description

@WillConker

Hi,

I'm new to webassemblyjs and I'm trying to use wasm-parser to parse and edit wasm binary code in a web application (using esbuild to bundle for web).
I compiled some rust code to wasm using wasm-bindgen, then in my js I tried to parse the binary wasm:

  binary => {
      const decoderOpts = {dump: true};
      const ast = decode(binary, decoderOpts);
  }

However, I get a parsing error: Error: Unexpected instruction: 0xfc08 when I run this. I opened my wasm file in a webassembly text viewer and saw that this was a memory.init 0 instruction (https://webassembly.github.io/spec/core/syntax/instructions.html#syntax-instr-memory). Is this instruction just not supported by webassemblyjs or am I missing something?

Version: @webassemblyjs/[email protected]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions