reko icon indicating copy to clipboard operation
reko copied to clipboard

Return value of malloc is getting lost

Open uxmal opened this issue 5 years ago • 0 comments

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.

uxmal avatar Aug 25 '20 16:08 uxmal