This was a last-minute addition to D117249, and of course I ended
up inverting the condition in a way that caused an uninitialized
memory read.
I've dropped it entirely, as I don't think we actually care whether
the size is zero or not here. The previous code wasn't checking
this either.
assert(isMallocLikeFn(CI, TLI) && "Must be malloc-like call");
uint64_t AllocSize;
- if (!getObjectSize(CI, AllocSize, DL, TLI, ObjectSizeOpts()) && AllocSize > 0)
+ if (!getObjectSize(CI, AllocSize, DL, TLI, ObjectSizeOpts()))
return false;
// Restrict this transformation to only working on small allocations