Linux

Steinar H. Gunderson: Decompilation patterns, part 15: Redundant if-for

Yet another way of writing for loops: var_a2_4 = … if (var_a2_4 < 0x78) { … do { … var_a2_4 += 1; } while (var_a2_4 < 0x78); } This extra if is merely there because the compiler wasn't able to prove that the variable didn't start below the bound, so it can't rewrite the while-do to a do-while without that extra check. So the rewrite still reads: for (var_a2_4 = …; var_a2_4 < 0x78; ++var_a2_4) { … } possibly with…

Quelle: Originalartikel öffnen

AI Assistant
Context loaded: Steinar H. Gunderson: Decompilation patterns, part 15: Redun