summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-04-09 19:54:33 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-04-09 19:54:33 +0000
commitdb42a3e876e1ff37a692380cc226cd155eda60cd (patch)
treea5deab7ede06195a3b2ba6a05f3185edbb843f18 /clang/lib
parent96d2507e790a2bdbf84a1fa72f6555ec5ef66884 (diff)
downloadbcm5719-llvm-db42a3e876e1ff37a692380cc226cd155eda60cd.tar.gz
bcm5719-llvm-db42a3e876e1ff37a692380cc226cd155eda60cd.zip
Make sure we or together the overflow flags of the multiply and add, so the
check is triggered appropriately. Reported on cfe-dev. llvm-svn: 129231
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGExprCXX.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprCXX.cpp b/clang/lib/CodeGen/CGExprCXX.cpp
index 8eee4a0b0c0..777036bc3b3 100644
--- a/clang/lib/CodeGen/CGExprCXX.cpp
+++ b/clang/lib/CodeGen/CGExprCXX.cpp
@@ -595,7 +595,7 @@ static llvm::Value *EmitCXXNewAllocSize(ASTContext &Context,
Size = CGF.Builder.CreateExtractValue(AddRes, 0);
llvm::Value *AddDidOverflow = CGF.Builder.CreateExtractValue(AddRes, 1);
- DidOverflow = CGF.Builder.CreateAnd(DidOverflow, AddDidOverflow);
+ DidOverflow = CGF.Builder.CreateOr(DidOverflow, AddDidOverflow);
}
Size = CGF.Builder.CreateSelect(DidOverflow,
OpenPOWER on IntegriCloud