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

Return value of malloc is getting lost #934

Open
uxmal opened this issue Aug 25, 2020 · 0 comments
Open

Return value of malloc is getting lost #934

uxmal opened this issue Aug 25, 2020 · 0 comments

Comments

@uxmal
Copy link
Owner

uxmal commented Aug 25, 2020

The following is the result of running Reko on subjects/Elf/Sparc/rtems:

// Called from:
//      unexpand_if_needed
//      output_bytes
Eq_n xrealloc(Eq_n o0, Eq_n o1, union Eq_n & i1Out, ptr32 & i2Out)
{
	bool v23_n;
	if (o0 != 0x00)
		v23_n = realloc(o0, o1) != null;
	else
		v23_n = malloc(o1) != null;
    // code elided

Clearly the intent is to keep the result of malloc and also compare it to null, but isn't happening.

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