Wrong decompilation of loop start
rfalke opened this issue · comments
rfalke commented
Version: c44f71e
Subject: https://github.com/rfalke/decompiler-subjects/tree/master/from_internet/asmutils/rot13/ia32_elf
The inner loop goes over all read bytes and optionally rotates them. Reko outputs:
for (ecx_26 = 0x03; ecx_26 != 0x00; --ecx_26)
for this loop. Here the 0x03
is wrong.
Maybe the reason is that reko doesn't know about the return value of the linux syscall.
John Källén commented
Likely; currently Reko has no support for such syscalls. See #1147.
John Källén commented
This is fixed in 9bd2f21. The for
-loop has morphed into a do-while
, but the code is actually correct now. The reason for the morphing is because Reko can't prove that ecx_xx != 0
is true at least once through the loop.