diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2012-06-21 16:47:58 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2012-06-21 16:47:58 +0000 |
commit | a6aa3d3b5f6ccfef68d68e586ffdb76ad64f53e7 (patch) | |
tree | 89c245adc0c9d3006606f3582bac8de9dd5ef743 /llvm/lib/Analysis | |
parent | 245f4ae59a3ea65d8bd022b989a8d62bbeab6f6d (diff) | |
download | bcm5719-llvm-a6aa3d3b5f6ccfef68d68e586ffdb76ad64f53e7.tar.gz bcm5719-llvm-a6aa3d3b5f6ccfef68d68e586ffdb76ad64f53e7.zip |
hopefully fix the buildbots: some tests have wrong definitions of malloc and were crashing this code on 64 bits machines
llvm-svn: 158923
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/MemoryBuiltins.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp index 2a1afdce329..436cffd6e8e 100644 --- a/llvm/lib/Analysis/MemoryBuiltins.cpp +++ b/llvm/lib/Analysis/MemoryBuiltins.cpp @@ -419,7 +419,7 @@ SizeOffsetType ObjectSizeOffsetVisitor::visitCallSite(CallSite CS) { if (!Arg) return unknown(); - APInt Size = Arg->getValue(); + APInt Size = Arg->getValue().zextOrSelf(IntTyBits); // size determined by just 1 parameter if (FnData->SndParam == (unsigned char)-1) return std::make_pair(Size, Zero); @@ -428,7 +428,7 @@ SizeOffsetType ObjectSizeOffsetVisitor::visitCallSite(CallSite CS) { if (!Arg) return unknown(); - Size *= Arg->getValue(); + Size *= Arg->getValue().zextOrSelf(IntTyBits); return std::make_pair(Size, Zero); // TODO: handle more standard functions (+ wchar cousins): @@ -602,11 +602,13 @@ SizeOffsetEvalType ObjectSizeOffsetEvaluator::visitCallSite(CallSite CS) { return unknown(); } - Value *FirstArg = CS.getArgument(FnData->FstParam); + Value *FirstArg = CS.getArgument(FnData->FstParam); + FirstArg = Builder.CreateZExt(FirstArg, IntTy); if (FnData->SndParam == (unsigned char)-1) return std::make_pair(FirstArg, Zero); Value *SecondArg = CS.getArgument(FnData->SndParam); + SecondArg = Builder.CreateZExt(SecondArg, IntTy); Value *Size = Builder.CreateMul(FirstArg, SecondArg); return std::make_pair(Size, Zero); |