aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/MemoryBuiltins.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-04-15 12:46:56 +0000
committerGabor Greif <ggreif@gmail.com>2010-04-15 12:46:56 +0000
commit9ee17208115482441953127615231c59a2f4d052 (patch)
treefea1c2465e14ae8c3d89e0cf07588155acf8a23d /lib/Analysis/MemoryBuiltins.cpp
parent45d95a1ad5eb72c65db8cc691a10339aa7c9c024 (diff)
downloadexternal_llvm-9ee17208115482441953127615231c59a2f4d052.zip
external_llvm-9ee17208115482441953127615231c59a2f4d052.tar.gz
external_llvm-9ee17208115482441953127615231c59a2f4d052.tar.bz2
back out r101364, as it trips the linux nightlybot on some clang C++ tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101368 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/MemoryBuiltins.cpp')
-rw-r--r--lib/Analysis/MemoryBuiltins.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Analysis/MemoryBuiltins.cpp b/lib/Analysis/MemoryBuiltins.cpp
index d677a69..89f9743 100644
--- a/lib/Analysis/MemoryBuiltins.cpp
+++ b/lib/Analysis/MemoryBuiltins.cpp
@@ -103,7 +103,7 @@ static Value *computeArraySize(const CallInst *CI, const TargetData *TD,
// If malloc calls' arg can be determined to be a multiple of ElementSize,
// return the multiple. Otherwise, return NULL.
- Value *MallocArg = CI->getOperand(0);
+ Value *MallocArg = CI->getOperand(1);
Value *Multiple = NULL;
if (ComputeMultiple(MallocArg, ElementSize, Multiple,
LookThroughSExt))
@@ -120,7 +120,7 @@ const CallInst *llvm::isArrayMalloc(const Value *I, const TargetData *TD) {
Value *ArraySize = computeArraySize(CI, TD);
if (ArraySize &&
- ArraySize != ConstantInt::get(CI->getOperand(0)->getType(), 1))
+ ArraySize != ConstantInt::get(CI->getOperand(1)->getType(), 1))
return CI;
// CI is a non-array malloc or we can't figure out that it is an array malloc.