luadec
luadec copied to clipboard
OP_CLOSURE decompiles incorrectly if Lua uses non-standard opcode order
Normal Lua stores opcode and operands in 32 bits in Op-A-C-B
order, but I have an implementation here that uses a different ordering which caused OP_CLOSURE
to decompile incorrectly. I found that the decompiler looks in register C for the function index, but this is wrong; it should look in Bx. I've made a PR to fix this issue (#73).
The disassembler already has the correct behaviour, so no changes are necessary there.