Submitted by:
Reviewed by:
Bozo bug in last checkin. Needed to move the check for null pointers
up (and out of the pointer/pointer clause).

llvm-svn: 39466
This commit is contained in:
Steve Naroff 2007-05-20 19:46:53 +00:00
parent 5ab15f154d
commit 30d1fbc803
2 changed files with 10 additions and 10 deletions

View File

@ -421,6 +421,11 @@ inline QualType Sema::CheckConditionalOperands( // C99 6.5.15
return QualType();
}
}
if (lhs->isPointerType() && RHS->isNullPointerConstant()) // C99 6.5.15p3
return lhs;
if (rhs->isPointerType() && LHS->isNullPointerConstant())
return rhs;
if (lhs->isPointerType() && rhs->isPointerType()) { // C99 6.5.15p3,6
QualType lhptee, rhptee;
@ -428,11 +433,6 @@ inline QualType Sema::CheckConditionalOperands( // C99 6.5.15
lhptee = cast<PointerType>(lhs.getCanonicalType())->getPointeeType();
rhptee = cast<PointerType>(rhs.getCanonicalType())->getPointeeType();
if (RHS->isNullPointerConstant()) // C99 6.5.15p3
return lhs;
if (LHS->isNullPointerConstant())
return rhs;
// ignore qualifiers on void (C99 6.5.15p3, clause 6)
if (lhptee.getUnqualifiedType()->isVoidType() &&
(rhptee->isObjectType() || rhptee->isIncompleteType()))

View File

@ -421,6 +421,11 @@ inline QualType Sema::CheckConditionalOperands( // C99 6.5.15
return QualType();
}
}
if (lhs->isPointerType() && RHS->isNullPointerConstant()) // C99 6.5.15p3
return lhs;
if (rhs->isPointerType() && LHS->isNullPointerConstant())
return rhs;
if (lhs->isPointerType() && rhs->isPointerType()) { // C99 6.5.15p3,6
QualType lhptee, rhptee;
@ -428,11 +433,6 @@ inline QualType Sema::CheckConditionalOperands( // C99 6.5.15
lhptee = cast<PointerType>(lhs.getCanonicalType())->getPointeeType();
rhptee = cast<PointerType>(rhs.getCanonicalType())->getPointeeType();
if (RHS->isNullPointerConstant()) // C99 6.5.15p3
return lhs;
if (LHS->isNullPointerConstant())
return rhs;
// ignore qualifiers on void (C99 6.5.15p3, clause 6)
if (lhptee.getUnqualifiedType()->isVoidType() &&
(rhptee->isObjectType() || rhptee->isIncompleteType()))