From 2c0c745709c9f258f4c968bcf3e891faa9acbca6 Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 25 Jan 2012 05:04:17 +0000 Subject: Fix a crash for an edge case of the GNU ?: extension. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148923 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index db87cba9a0..5c2061bed0 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1999,6 +1999,8 @@ EmitConditionalOperatorLValue(const AbstractConditionalOperator *expr) { return EmitAggExprToLValue(expr); } + OpaqueValueMapping binding(*this, expr); + const Expr *condExpr = expr->getCond(); bool CondExprBool; if (ConstantFoldsToSimpleInteger(condExpr, CondExprBool)) { @@ -2009,8 +2011,6 @@ EmitConditionalOperatorLValue(const AbstractConditionalOperator *expr) { return EmitLValue(live); } - OpaqueValueMapping binding(*this, expr); - llvm::BasicBlock *lhsBlock = createBasicBlock("cond.true"); llvm::BasicBlock *rhsBlock = createBasicBlock("cond.false"); llvm::BasicBlock *contBlock = createBasicBlock("cond.end"); -- cgit v1.2.3