From befbcf4e02756f252d1263774ef2249f0921c1c9 Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Fri, 27 Feb 2009 03:16:57 +0000 Subject: [PATCH] The middle operand in ?: is optional, really. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65609 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/Expr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index ed51fbaa68..c0e8ad15e7 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -334,7 +334,7 @@ bool Expr::isUnusedResultAWarning(SourceLocation &Loc, SourceRange &R1, // The condition must be evaluated, but if either the LHS or RHS is a // warning, warn about them. const ConditionalOperator *Exp = cast(this); - if (Exp->getLHS()->isUnusedResultAWarning(Loc, R1, R2)) + if (Exp->getLHS() && Exp->getLHS()->isUnusedResultAWarning(Loc, R1, R2)) return true; return Exp->getRHS()->isUnusedResultAWarning(Loc, R1, R2); } -- 2.40.0