Closed jaames closed 2 years ago
I managed to reproduce it here: https://jsfiddle.net/3sgqw8Lx/6/
Any idea what's causing it? If I remember correctly, Lua is able to automatically determine whether a file is plaintext or bytecode so I figured it would "just work" :)
Just tried it with another compiled file and it succeeds:
echo 'print("Hello, world!")' | ./luac - && wasmoon luac.out
Hello, world!
How are you compiling your file @jaames?
Hello! I'm trying to load a compiled Lua bytecode file (test.luac.zip) that was compiled for Panic's Playdate game console. As far as I understand, both the Playdate's Lua implementation and Wasmoon's Lua runtime is Lua 5.4 compiled with
#define LUA_32BITS 1
, so in theory they should be compatible?To load bytecode, I'm calling
factory.mountFile
with the bytecode contents, and then loading that file withlua.doFile
. If loaded correctly, the bytecode should print"hello world"
. Here's my code:I seem to be getting a "memory access out of bounds" error here no matter what I try. I've tested it in various browsers on macOS 12.5 and get a similar error in different browsers:
Chrome 104.0.5112.79:
Firefox 103.0.2:
Safari 15.6:
Any pointers would be super appreciated, and would be happy to donate or contribute if that would help!
Thanks for your time, and congrats on the excellent library!