summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-05 05:40:13 +0000
committerChris Lattner <sabre@nondot.org>2009-12-05 05:40:13 +0000
commit9a152e25702d5520adcba3ff88cdae92d7ba880c (patch)
treebd2b3bd453d03a7d8cab9c3e33e0492e7dcc7b0b /clang/lib/Sema
parenta0e9d700dc26f3adf73488dd263cd7b552b17bf1 (diff)
downloadbcm5719-llvm-9a152e25702d5520adcba3ff88cdae92d7ba880c.tar.gz
bcm5719-llvm-9a152e25702d5520adcba3ff88cdae92d7ba880c.zip
fix rdar://7446395, a crash on invalid, by fixing a broken assertion.
llvm-svn: 90647
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index da1fe3d44d7..bb040b2ee45 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -5014,6 +5014,7 @@ QualType Sema::CheckCompareOperands(Expr *&lex, Expr *&rex, SourceLocation Loc,
unsigned OpaqueOpc, bool isRelational) {
BinaryOperator::Opcode Opc = (BinaryOperator::Opcode)OpaqueOpc;
+ // Handle vector comparisons separately.
if (lex->getType()->isVectorType() || rex->getType()->isVectorType())
return CheckVectorCompareOperands(lex, rex, Loc, isRelational);
@@ -5091,17 +5092,15 @@ QualType Sema::CheckCompareOperands(Expr *&lex, Expr *&rex, SourceLocation Loc,
}
// The result of comparisons is 'bool' in C++, 'int' in C.
- QualType ResultTy = getLangOptions().CPlusPlus? Context.BoolTy :Context.IntTy;
+ QualType ResultTy = getLangOptions().CPlusPlus ? Context.BoolTy:Context.IntTy;
if (isRelational) {
if (lType->isRealType() && rType->isRealType())
return ResultTy;
} else {
// Check for comparisons of floating point operands using != and ==.
- if (lType->isFloatingType()) {
- assert(rType->isFloatingType());
+ if (lType->isFloatingType() && rType->isFloatingType())
CheckFloatComparison(Loc,lex,rex);
- }
if (lType->isArithmeticType() && rType->isArithmeticType())
return ResultTy;
OpenPOWER on IntegriCloud