Steinar H. Gunderson: Decompilation patterns, part 5: Nested if/goto

Here's a pattern that sometimes comes up: if (x == 3) { if (y == 4) { … } else { goto label_5; } } else { label_5: … } We don't like gotos, and here, it's pretty obvious what was meant, namely: if (x == 3 && y == 4) { … } else { label_5: … } And now you can usually delete label_5 because nothing points to it. Often, m2c can do this by itself, but as…
Quelle: Originalartikel öffnen
