SwadicalRag / wasm2lua

wasm2lua: converting WASM into Lua
MIT License
190 stars 10 forks source link

Try that and never works #32

Open swang206 opened 2 years ago

swang206 commented 2 years ago

Can you show us a demo on how to run

include

int main() { puts("Hello World\n"); }

?

swang206 commented 2 years ago

/home/cqwrteur/myhome/wasm2lua/node_modules/wasm2lua/js/index.js:1840 let loadOffset = ins.args[0].value; ^

TypeError: Cannot read properties of undefined (reading 'value') at wasm2lua.processInstructionsPass2 (/home/cqwrteur/myhome/wasm2lua/node_modules/wasm2lua/js/index.js:1840:62) at wasm2lua.processFunc (/home/cqwrteur/myhome/wasm2lua/node_modules/wasm2lua/js/index.js:853:30) at wasm2lua.processModule (/home/cqwrteur/myhome/wasm2lua/node_modules/wasm2lua/js/index.js:434:38) at wasm2lua.process (/home/cqwrteur/myhome/wasm2lua/node_modules/wasm2lua/js/index.js:335:38) at new wasm2lua (/home/cqwrteur/myhome/wasm2lua/node_modules/wasm2lua/js/index.js:105:14) at Object. (/home/cqwrteur/myhome/wasm2lua/node_modules/wasm2lua/js/bin/wasm2lua.js:85:12) at Module._compile (node:internal/modules/cjs/loader:1101:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12)

swang206 commented 2 years ago

cqwrteur@Home-Server:~/myhome/wasm2lua$ wasm2lua ./a out.lua /home/cqwrteur/myhome/wasm2lua/node_modules/wasm2lua/js/index.js:1790 let loadOffset = ins.args[0].value; ^

TypeError: Cannot read properties of undefined (reading 'value') at wasm2lua.processInstructionsPass2 (/home/cqwrteur/myhome/wasm2lua/node_modules/wasm2lua/js/index.js:1790:58) at wasm2lua.processFunc (/home/cqwrteur/myhome/wasm2lua/node_modules/wasm2lua/js/index.js:853:30) at wasm2lua.processModule (/home/cqwrteur/myhome/wasm2lua/node_modules/wasm2lua/js/index.js:434:38) at wasm2lua.process (/home/cqwrteur/myhome/wasm2lua/node_modules/wasm2lua/js/index.js:335:38) at new wasm2lua (/home/cqwrteur/myhome/wasm2lua/node_modules/wasm2lua/js/index.js:105:14) at Object. (/home/cqwrteur/myhome/wasm2lua/node_modules/wasm2lua/js/bin/wasm2lua.js:85:12) at Module._compile (node:internal/modules/cjs/loader:1097:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10) at Module.load (node:internal/modules/cjs/loader:975:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12)

Node.js v18.0.0-pre

SwadicalRag commented 2 years ago

I may not be able to debug this myself, but could I ask a favour? Could you attach the .wasm file that you used to generate this error?

If you are feeling extra brave, you can also try to attach a minimum reproducible example

Diminim commented 1 year ago

Hi I'd like to +1 this issue. I installed wasm2lua using yarn and ran into a similar if not the same error report. I tested this on .wasm files you provided in https://github.com/SwadicalRag/bullet3-lua/releases/ and https://github.com/SwadicalRag/brotli-lua/releases/ and did not have any success. Are you still able to get it to work yourself?