diff options
author | Victor Hernandez <vhernandez@apple.com> | 2009-10-16 18:08:17 +0000 |
---|---|---|
committer | Victor Hernandez <vhernandez@apple.com> | 2009-10-16 18:08:17 +0000 |
commit | 136526ce2d2ea86450f4205e20f3fda24ac16a5b (patch) | |
tree | 24b4f1046ddd111dbba38b3d0e75d948522f729f /lib | |
parent | 3a73bb38ba4ab88f5013bff3fa0584dce2fa9336 (diff) |
Invert isSafeToGetMallocArraySize check because we return NULL when we don't know the size.
Thanks to Duncan Sands for noticing this bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84261 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/MallocHelper.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/MallocHelper.cpp b/lib/Analysis/MallocHelper.cpp index 41fdab9012..e7bb41eeec 100644 --- a/lib/Analysis/MallocHelper.cpp +++ b/lib/Analysis/MallocHelper.cpp @@ -234,7 +234,7 @@ static bool isConstantOne(Value *val) { /// determined. Value* llvm::getMallocArraySize(CallInst* CI, LLVMContext &Context, const TargetData* TD) { - if (isSafeToGetMallocArraySize(CI, Context, TD)) + if (!isSafeToGetMallocArraySize(CI, Context, TD)) return NULL; // Match CreateMalloc's use of constant 1 array-size for non-array mallocs. |