luadec icon indicating copy to clipboard operation
luadec copied to clipboard

OP_CLOSURE decompiles incorrectly if Lua uses non-standard opcode order

Open jalbert-dev opened this issue 4 years ago • 0 comments

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.

jalbert-dev avatar Aug 16 '20 03:08 jalbert-dev