Open AdamMil opened 5 years ago
I believe it's because this code in DecompileLoopJumpInstruction can skip ahead even when the current op is not OP_LINE.
bool bHasLineInfo = !m_LineInfos.empty();
...
if (bHasLineInfo) // skip OP_LINE
state.NextInstruction();
I tried adding another check:
bool bHasLineInfo = !m_LineInfos.empty() && m_Instructions[state.IP()].op == OP_LINE;
Try compiling this function.
Then decompile it. You get this result:
In fact, whatever the condition of the 'if' is will be duplicated on the next line. E.g.
becomes:
when it's placed inside the foreach loop.