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

Variable value can change when address is taken #984

Open
rfalke opened this issue Dec 2, 2020 · 0 comments
Open

Variable value can change when address is taken #984

rfalke opened this issue Dec 2, 2020 · 0 comments
Labels
local-stack-variables This issue is about incorrect propagation/elimination of local stack variables

Comments

@rfalke
Copy link

rfalke commented Dec 2, 2020

Subject: https://github.com/rfalke/decompiler-subjects/tree/master/from_holdec/change_local_via_function/ia32_elf

Source:

int main() {
    int x=41;
    inc(&x);
    printf("The answer should be 42 and is %d\n", x);
    return 0;
}

Output:

void main()
{
	__align(fp);
	inc(fp - 0x14);
	printf("The answer should be 42 and is %d\n", 0x29);
}

The 0x29 in the printf call is wrong.

Also the argument to inc looks strange.

@ptomin ptomin added the local-stack-variables This issue is about incorrect propagation/elimination of local stack variables label Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
local-stack-variables This issue is about incorrect propagation/elimination of local stack variables
Projects
None yet
Development

No branches or pull requests

2 participants