Invert isSafeToGetMallocArraySize check because we return NULL when we don't know the size.

Thanks to Duncan Sands for noticing this bug.

llvm-svn: 84261
This commit is contained in:
Victor Hernandez 2009-10-16 18:08:17 +00:00
parent c81923e07c
commit 6f834660c9
1 changed files with 1 additions and 1 deletions

View File

@ -234,7 +234,7 @@ static bool isConstantOne(Value *val) {
/// determined. /// determined.
Value* llvm::getMallocArraySize(CallInst* CI, LLVMContext &Context, Value* llvm::getMallocArraySize(CallInst* CI, LLVMContext &Context,
const TargetData* TD) { const TargetData* TD) {
if (isSafeToGetMallocArraySize(CI, Context, TD)) if (!isSafeToGetMallocArraySize(CI, Context, TD))
return NULL; return NULL;
// Match CreateMalloc's use of constant 1 array-size for non-array mallocs. // Match CreateMalloc's use of constant 1 array-size for non-array mallocs.