You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The nesm wasm parser fails when loading WebAssembly binaries that use the memory64 and table64 proposals (i.e., wasm64 binaries). The error is:
Invalid module: Unsigned LEB128 value overflows uint32
This occurs because memory64/table64 use 64-bit LEB128 values for memory limits and table sizes, but the parser currently uses uint32 for LEB128 decoding in those sections.
Reproduction
Load any wasm binary compiled with Emscripten's -sMEMORY64=1 flag. For example, .NET's CoreCLR interpreter compiled for browser-wasm64:
Both wasm_load_file and wasm_inspect fail with the LEB128 overflow error. Native wasm-objdump (from WABT) parses the same binary correctly.
Affected tools
All tools that parse the binary are affected: wasm_load_file, wasm_inspect, wasm_load_binary, wasm_run, etc.
Context
The memory64 proposal is now at Phase 4 and shipping in V8 (Chrome/Node.js). It's used by .NET's CoreCLR wasm64 port to support >4GB linear memory for managed applications. Support in nesm would enable using the MCP tools for debugging and inspecting wasm64 binaries.
Note
This issue was generated with the help of Copilot.
Summary
The nesm wasm parser fails when loading WebAssembly binaries that use the memory64 and table64 proposals (i.e., wasm64 binaries). The error is:
This occurs because memory64/table64 use 64-bit LEB128 values for memory limits and table sizes, but the parser currently uses
uint32for LEB128 decoding in those sections.Reproduction
Load any wasm binary compiled with Emscripten's
-sMEMORY64=1flag. For example, .NET's CoreCLR interpreter compiled forbrowser-wasm64:Both
wasm_load_fileandwasm_inspectfail with the LEB128 overflow error. Nativewasm-objdump(from WABT) parses the same binary correctly.Affected tools
All tools that parse the binary are affected:
wasm_load_file,wasm_inspect,wasm_load_binary,wasm_run, etc.Context
The memory64 proposal is now at Phase 4 and shipping in V8 (Chrome/Node.js). It's used by .NET's CoreCLR wasm64 port to support >4GB linear memory for managed applications. Support in nesm would enable using the MCP tools for debugging and inspecting wasm64 binaries.
Note
This issue was generated with the help of Copilot.