binaryen.js icon indicating copy to clipboard operation
binaryen.js copied to clipboard

Module#getFeatures() returns 0 for module using SIMD128 and bulk memory ops

Open sbalko opened this issue 3 years ago • 1 comments

There seems to be an issue with the Module#getFeatures() call when run on a module that uses features beyond the WebAssembly MVP scope. In my case, I am using SIMD128 and bulk memory optimizations. This is confirmed when I run Module#validate(), which interestingly prints out errors like:

[wasm-validator error in function xyz] unexpected false: SIMD operation (SIMD is disabled), on ...

Note that I am using binaryen.js inside a node.js script (a mocha test script that runs some smoke tests on my WebAssembly module).

sbalko avatar Jan 14 '22 06:01 sbalko

Does this happen when loading an existing module, or when creating a new module? In the former case it might be that loading a module does not yet detect the features used, and that another call of setFeatures is necessary. Just a guess, though.

dcodeIO avatar Jan 14 '22 10:01 dcodeIO