You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to understand this problem, we must understand the nature of the decompilation process.
your code is compiled to the following by the lua 5.2 compiler:
if r0_1 ~= nil then goto label_2 end
goto label_7
::label_2::
r1_1 = _ENV["type"]
r2_1 = r0_1
r1_1 = r1_1(r2_1)
if r1_1 ~= "function" then goto label_7 end
goto label_8
::label_7::
r1_1 = false ; goto label_9
::label_8::
r1_1 = true
::label_9::
return r1_1
the issue occurs, because label_7 has multiple predecessors.
if you load this file up in metaworm's luadec and check out the graph view, you'll be able to see exactly what i mean:
what happens is that the comparison is optimized into block#1, and the instruction at label_7 "disappears".
what seems like a simple issue at first becomes very difficult to tackle, because you must design an algorithm that correctly identifies these cases and solves them, no matter the amount of nested expressions, etc.
Consider this simple Lua 5.2 function:
Compile with LuaC
The decompilation result will be like this:
Note that it tries to
goto label_7
butlabel_7
is never defined anywhere.The text was updated successfully, but these errors were encountered: