Open AdamMil opened 5 years ago
Compile this code:
i = 1 do j = 0 while (j)
Then decompile it with NutCracker. The result is:
do { this.i = 1; this.j = 0; } while (this.j);
In general, one operation before a do/while loop is included in the loop. I believe the reason is that the beginning of the loop is calculated incorrectly. In PreprocessDoWhileInfo there's this line:
PreprocessDoWhileInfo
int beginPos = endPos + curInst.arg1;
I think it should be replaced with:
int beginPos = endPos + 1 + curInst.arg1;
a real mvp shares this fix! thanks @AdamMil
Compile this code:
Then decompile it with NutCracker. The result is:
In general, one operation before a do/while loop is included in the loop. I believe the reason is that the beginning of the loop is calculated incorrectly. In
PreprocessDoWhileInfo
there's this line:I think it should be replaced with: