lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Wed, Jan 23, 2019 at 11:57 PM Luiz Henrique de Figueiredo wrote:
> "luac" fails to display a bytecode containing VM instruction with reserved opcode.

Could you please send me a sample file? Thanks.

The crash could be reproduced on any Luac version.
For example, to create such bytecode for little-endian Luac 5.3, it is enough to replace the "return" instruction with reserved opcode=63
bad_bytecode = string.dump(load""):gsub(string.char(38,0,128,0), string.char(63, 0, 0, 0))


> The "format" byte in the header of a GameGuardian bytecode is zero.

They should have changed that! It's there precisely to alert the loader!

If GG script isn't using extended syntax (new bitwise operators)
then the resulting GG bytecode is compatible with PUC Lua 5.2 bytecode.
And any PUC Lua 5.2 bytecode is a correct GG bytecode too.
(Assuming endianness and bitness are the same, of course.)
Probably, in this case, using format=0 is OK?