lua-users home
lua-l archive

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


"NoW" means "Nitpicking on Wednesdays"
(unimportant questions about Lua design and implementation)

 
 
The problem:
"luac" fails to display a bytecode containing VM instruction with reserved opcode.
 
Suggestion:
It would be better to display undefined instruction as four numbers (opcode,A,B,C) instead of get crashed.
 
Why it may be useful:
Some Lua scripting environments add new instructions to Lua VM.
For example, "GameGuardian" (a memory patching tool for cracking android games) implements Lua 5.2 with extended syntax.
Opcode 43 is reserved шn PUC Lua 5.2 VM, but in GameGuardian Lua VM this opcode is used for VM instruction "bitwise OR".
Yes, they have both the function "bit32.bor(x,y)" and the operator "x|y" simultaneously in the language.
I guess GameGuardian is not the only occasion when Lua implementation has new VM instructions added without modifying the original instructions.
It would be nice if such bytecode would be viewable with standard "luac" utility.
 
P.S.
The "format" byte in the header of a GameGuardian bytecode is zero.