diff options
author | Anders Carlsson <andersca@mac.com> | 2010-01-24 00:20:05 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-01-24 00:20:05 +0000 |
commit | 08e9e453f40aff95a59bd67db49b8f050765e1f0 (patch) | |
tree | bc8f2c0029f2e659f864977e042cf3135e2e08dc /lib/CodeGen/CodeGenFunction.cpp | |
parent | 1b36a2fcb2cea310c01fc2a80a9da915e5d2ceb0 (diff) |
Fix a nasty bug where temporaries weren't marked as being conditional in some cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94341 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index f0a5c64d2f..5db441197e 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -431,7 +431,11 @@ void CodeGenFunction::EmitBranchOnBoolExpr(const Expr *Cond, EmitBranchOnBoolExpr(CondBOp->getLHS(), LHSTrue, FalseBlock); EmitBlock(LHSTrue); + // Any temporaries created here are conditional. + StartConditionalBranch(); EmitBranchOnBoolExpr(CondBOp->getRHS(), TrueBlock, FalseBlock); + FinishConditionalBranch(); + return; } else if (CondBOp->getOpcode() == BinaryOperator::LOr) { // If we have "0 || X", simplify the code. "1 || X" would have constant @@ -454,7 +458,11 @@ void CodeGenFunction::EmitBranchOnBoolExpr(const Expr *Cond, EmitBranchOnBoolExpr(CondBOp->getLHS(), TrueBlock, LHSFalse); EmitBlock(LHSFalse); + // Any temporaries created here are conditional. + StartConditionalBranch(); EmitBranchOnBoolExpr(CondBOp->getRHS(), TrueBlock, FalseBlock); + FinishConditionalBranch(); + return; } } |