r267313 - Fix a couple assertions that can never fire because the condition ANDed with the string is just true or 1.

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 23 19:08:22 PDT 2016


Author: ctopper
Date: Sat Apr 23 21:08:22 2016
New Revision: 267313

URL: http://llvm.org/viewvc/llvm-project?rev=267313&view=rev
Log:
Fix a couple assertions that can never fire because the condition ANDed with the string is just true or 1.

Modified:
    cfe/trunk/lib/Frontend/Rewrite/RewriteModernObjC.cpp
    cfe/trunk/lib/Frontend/Rewrite/RewriteObjC.cpp

Modified: cfe/trunk/lib/Frontend/Rewrite/RewriteModernObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/Rewrite/RewriteModernObjC.cpp?rev=267313&r1=267312&r2=267313&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/Rewrite/RewriteModernObjC.cpp (original)
+++ cfe/trunk/lib/Frontend/Rewrite/RewriteModernObjC.cpp Sat Apr 23 21:08:22 2016
@@ -4640,7 +4640,7 @@ Stmt *RewriteModernObjC::SynthesizeBlock
                = dyn_cast<PseudoObjectExpr>(BlockExp)) {
     CPT = POE->getType()->castAs<BlockPointerType>();
   } else {
-    assert(1 && "RewriteBlockClass: Bad type");
+    assert(false && "RewriteBlockClass: Bad type");
   }
   assert(CPT && "RewriteBlockClass: Bad type");
   const FunctionType *FT = CPT->getPointeeType()->getAs<FunctionType>();

Modified: cfe/trunk/lib/Frontend/Rewrite/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/Rewrite/RewriteObjC.cpp?rev=267313&r1=267312&r2=267313&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/Rewrite/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Frontend/Rewrite/RewriteObjC.cpp Sat Apr 23 21:08:22 2016
@@ -3748,7 +3748,7 @@ Stmt *RewriteObjC::SynthesizeBlockCall(C
                = dyn_cast<PseudoObjectExpr>(BlockExp)) {
     CPT = POE->getType()->castAs<BlockPointerType>();
   } else {
-    assert(1 && "RewriteBlockClass: Bad type");
+    assert(false && "RewriteBlockClass: Bad type");
   }
   assert(CPT && "RewriteBlockClass: Bad type");
   const FunctionType *FT = CPT->getPointeeType()->getAs<FunctionType>();




More information about the cfe-commits mailing list