metaworm / luac-parser-rs

lua bytecode parser written in Rust using nom, part of metaworm's lua decompiler, support lua51/lua52/lua53/lua54/luajit/luau https://luadec.metaworm.site/
https://luadec.metaworm.site/
204 stars 28 forks source link

TFORLOOP 5.1 problem #24

Open toxamin opened 1 year ago

toxamin commented 1 year ago

When given the following script:

for i in ipairs(_table) do
end

Metaworm's luadec generates the following result:

-- error: decompile function#0: generate_block
-- 
-- Caused by:
--     conditional block should not has goto statement

This only happens on Lua 5.1, where there are no instructions between JMP and TFORLOOP.

metaworm commented 1 year ago

Thank you for your meticulous testing. I have fixed many issues you reported, but it has also introduced new problems. I need some more time to continue refining before I can release it.