// Get information about the base datatype being allocated, before & after
int ReqTypeSize = TD.getTypeSize(Ty);
+ if (ReqTypeSize == 0) return false;
unsigned OldTypeSize = TD.getTypeSize(MI->getType()->getElementType());
// Must have a scale or offset to analyze it...
if (!ElTy->isSized() || (isa<PointerType>(CompTy) && !Indices.empty()))
return 0; // Type is unreasonable... escape!
unsigned ElSize = TD.getTypeSize(ElTy);
+ if (ElSize == 0) return 0; // Avoid division by zero...
int64_t ElSizeS = ElSize;
// See if the user is indexing into a different cell of this array...