Linux

Steinar H. Gunderson: Decompilation patterns, part 11: Irregular switch

Here's one that m2c usually gets right itself, but sometimes cannot: if (var_v1_7 != 1) { if (var_v1_7 < 2) { if (var_v1_7 != 0) { spF0 = 40; } else { vram_x = cmt46->vram_x; vram_y = cmt46->vram_y; spF0 = 40; } } else if (var_v1_7 != 2) { if (var_v1_7 != 3) { Repeated comparisons against the same variable, especially in a nested form that could be binary search, should remind you of one thing: A switch. Usually, the…

Quelle: Originalartikel öffnen

AI Assistant
Context loaded: Steinar H. Gunderson: Decompilation patterns, part 11: Irreg