-
Notifications
You must be signed in to change notification settings - Fork 250
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
C-Output: return expressions directly #901
Comments
I prefer
in this case. |
Because this case has a larger expression or in general? So what about a simpler case? Current output:
I would prefer:
or
or
The main improvement IMHO is that you can see that both branches of the if-else assign to the same variable. There may also be a language which allows something like the following which also would capture this (but it is still longer than the others above and leaves the well known C paths):
|
I think decompiled code should be as close to original as possible.
if there is conditional jump in assembly code and
if there is no jumps. |
So for you "original" means the assembler. I would argue that different compilers translate the same source code to different assembler instructions and I would like to read an output code which doesn't have this variants. This would make the output easier to read. So something like "same semantics should result in the same output code". |
Issue is still in version 0.11.4.0-931ca7d. |
Subject: https://github.com/rfalke/decompiler-subjects/tree/master/from_holdec/dmi/exp/ia32_elf
Output
Expected:
Maybe it is also an improvement to replace "0x00" with "0" to reduce the output size.
The text was updated successfully, but these errors were encountered: