[cfe-commits] r39466 - in /cfe/cfe/trunk: AST/SemaExpr.cpp Sema/SemaExpr.cpp

Steve Naroff snaroff at apple.com
Wed Jul 11 09:44:43 PDT 2007


Author: snaroff
Date: Wed Jul 11 11:44:43 2007
New Revision: 39466

URL: http://llvm.org/viewvc/llvm-project?rev=39466&view=rev
Log:
Bug #:
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).

Modified:
    cfe/cfe/trunk/AST/SemaExpr.cpp
    cfe/cfe/trunk/Sema/SemaExpr.cpp

Modified: cfe/cfe/trunk/AST/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/AST/SemaExpr.cpp?rev=39466&r1=39465&r2=39466&view=diff

==============================================================================
--- cfe/cfe/trunk/AST/SemaExpr.cpp (original)
+++ cfe/cfe/trunk/AST/SemaExpr.cpp Wed Jul 11 11:44:43 2007
@@ -421,6 +421,11 @@
       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 @@
     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()))

Modified: cfe/cfe/trunk/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Sema/SemaExpr.cpp?rev=39466&r1=39465&r2=39466&view=diff

==============================================================================
--- cfe/cfe/trunk/Sema/SemaExpr.cpp (original)
+++ cfe/cfe/trunk/Sema/SemaExpr.cpp Wed Jul 11 11:44:43 2007
@@ -421,6 +421,11 @@
       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 @@
     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()))





More information about the cfe-commits mailing list