webassemblyjs
webassemblyjs copied to clipboard
Toolchain for WebAssembly
### Description Because of the `assertNotIdentifier` calls in [wasm-gen/lib/encoder/index.js](https://github.com/xtuc/webassemblyjs/blob/master/packages/wasm-gen/src/encoder/index.js), editing, say, a module export name can throw with the default decode options. ### Steps to repro Start with input WASM...
see https://github.com/WebAssembly/spec/blob/master/interpreter/main/main.ml#L5-L6
Continuing the discussion on Slack. Here's a list of proposal that we mentioned. ### Sign-extension operators https://github.com/WebAssembly/design/issues/1178 This impacts the wasm format and type-checker (validation), new instructions needs to be...
Happens with binary with a lot of code: ``` /webassemblyjs/packages/wasm-parser/lib/decoder.js:571 function parseInstructionBlock(code) { ^ RangeError: Maximum call stack size exceeded at parseInstructionBlock (/webassemblyjs/packages/wasm-parser/lib/decoder.js:571:33) at parseInstructionBlock (/webassemblyjs/packages/wasm-parser/lib/decoder.js:660:9) at parseInstructionBlock (/webassemblyjs/packages/wasm-parser/lib/decoder.js:660:9) at...
Following https://github.com/xtuc/webassemblyjs/pull/363#discussion_r191265408 TODO: uncomment https://github.com/xtuc/webassemblyjs/pull/363/files/00d7c695f67527afd3008df05390b835f68a6886#diff-06c2d5c8cd0c6a3f1daab4294ab6a166
```wat (module (global (export "v") i32 (i32.const 1)) ) ``` and the corresponding AST is: ```wat (module (global $global_0 i32 (i32.const 1)) (export "v" (global $global_0)) ) ``` The issues:...
As well as the validations.
Currently we store them as instructions in the function body which is closer to text format, but conceptually not quite right since they're not instructions. I think we should move...