In DecompileLoopJumpInstruction, if the jump is backwards to the start of the loop it may decompile it as a continue statement, but it doesn't set the UsedBackwardJumpContinue flag, so the postprocessing step may convert it to a for loop improperly. See this code:
local i,x
while(true)
{
if(x) continue;
i++;
}
When compiled and decompiled (assuming some other bugs are fixed), the result is:
local i;
for( local x; true; i++ )
{
if (x)
{
continue;
}
}
This is not equivalent. In the first example, the increment is skipped if x is true but in the second example it is not.
In
DecompileLoopJumpInstruction
, if the jump is backwards to the start of the loop it may decompile it as a continue statement, but it doesn't set theUsedBackwardJumpContinue
flag, so the postprocessing step may convert it to a for loop improperly. See this code:When compiled and decompiled (assuming some other bugs are fixed), the result is:
This is not equivalent. In the first example, the increment is skipped if
x
is true but in the second example it is not.