luau-lang / luau

A fast, small, safe, gradually typed embeddable scripting language derived from Lua
https://luau-lang.org
MIT License
3.8k stars 352 forks source link

luau_load can't load this if I export the bytecode and manually put it inside Luau "ASSERTION FAILED: index < count" #1211

Closed karl-police closed 3 months ago

karl-police commented 3 months ago

If I compile this source code and output the bytecode on a file.

local test = "wat"

function modify()
    test = "modified"
end

modify()

luau_load can't load this bytecode

Now, I am not sure if this is an issue, since I don't think Luau has a command line to export bytecode, but I did modify it to export it, so I am not sure. It looks like the bytecode must be different when Luau compiles it, it's a bit strange.

But there were some tests inside of Compile.test.cpp but this is at compile time... So I am not sure.