Fix for PR3150: obvious copy-paste bug in

ScalarExprEmitter::VisitBinLOr.

llvm-svn: 60415
This commit is contained in:
Eli Friedman 2008-12-02 16:02:46 +00:00
parent 9af949105a
commit e918435f94
2 changed files with 6 additions and 2 deletions

View File

@ -1077,9 +1077,9 @@ Value *ScalarExprEmitter::VisitBinLOr(const BinaryOperator *E) {
return Builder.CreateZExt(RHSCond, CGF.LLVMIntTy, "lor.ext");
}
// 1 || RHS: If it is safe, just elide the RHS, and return 0.
// 1 || RHS: If it is safe, just elide the RHS, and return 1.
if (!CGF.ContainsLabel(E->getRHS()))
return llvm::Constant::getNullValue(CGF.LLVMIntTy);
return llvm::ConstantInt::get(CGF.LLVMIntTy, 1);
}
llvm::BasicBlock *ContBlock = CGF.createBasicBlock("lor.end");

View File

@ -0,0 +1,4 @@
// RUN: clang -emit-llvm -o - %s | grep "store i32 1"
// PR3150
int a() {return 1||1;}