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

Extra cast in output #681

Open
rfalke opened this issue Sep 11, 2018 · 2 comments
Open

Extra cast in output #681

rfalke opened this issue Sep 11, 2018 · 2 comments
Labels
bug This issue describes a defect in Reko

Comments

@rfalke
Copy link

rfalke commented Sep 11, 2018

Exe: https://github.com/rfalke/decompiler-subjects/blob/master/from_holdec/dmi/cfg/ia32_elf/subject.exe
Reko version: 46f203b

Output:

// 08049110: void basic_5_head_controlled_loop(Stack Eq_19 dwArg04)
void basic_5_head_controlled_loop(Eq_19 dwArg04)
{
	puts("before");
	Eq_19 ebx_13 = dwArg04;
	while (ebx_13 != 0x2A)
	{
		puts("body");
		ebx_13 = (word32) ebx_13 + 0x01;
	}
	puts("after");
}

The second assignment to ebx_13 has a cast which shouldn't be there.

@uxmal uxmal added the bug This issue describes a defect in Reko label Sep 11, 2018
@uxmal
Copy link
Owner

uxmal commented Sep 11, 2018

Type inference is incorrectly generating a union Eq_19. Let's see what can be done about that.

@rfalke
Copy link
Author

rfalke commented Aug 26, 2023

Output of version 0.11.4.0-931ca7d:

void basic_5_head_controlled_loop(Eq_10 dwArg04)
{
	puts("before");
	time_t ebx_14 = dwArg04;
	while (ebx_14 != 0x2A)
	{
		puts("body");
		ebx_14 = (Eq_10) ((word32) ebx_14 + 1);
	}
	puts("after");
}

There are now 2 casts instead of 0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a defect in Reko
Projects
None yet
Development

No branches or pull requests

2 participants