Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cases where propagation should be limited/reverted #11

Open
pfalcon opened this issue Dec 30, 2017 · 2 comments
Open

Cases where propagation should be limited/reverted #11

pfalcon opened this issue Dec 30, 2017 · 2 comments

Comments

@pfalcon
Copy link
Owner

pfalcon commented Dec 30, 2017

No description provided.

@pfalcon
Copy link
Owner Author

pfalcon commented Dec 30, 2017

040-bzero:

    $a6 = $a2_0;
    if (cond) {
      $a6 = $a2_0 + 0x1;
    }

Here, it would be better to have:

    $a6 = $a2_0;
    if (cond) {
      $a6 += 0x1;
    }

@pfalcon
Copy link
Owner Author

pfalcon commented Dec 30, 2017

040-bzero:

      do {
        *(u8*)$a6 = 0x0;
        *(u8*)($a6 + 0x1) = 0x0;
        $a6 += 0x2;
      } while ($a6 != $a2_0 + $a3_0);

Condition in while. Fairly speaking, for decompilation understanding that's probably better than having a test against a variable with meaningless name. But for reusing decompiled output, constant subexpressions should be hoisted out of the loop for efficiency. (On the other hand, an optimizing compiler would do that itself.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant