[PATCH] D12818: [Static Analyzer] Relaxing a caching out related assert.

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 11 13:51:57 PDT 2015


xazax.hun created this revision.
xazax.hun added reviewers: zaks.anna, dcoughlin, jordan_rose, krememek.
xazax.hun added a subscriber: cfe-commits.

During the development of the nullability checkers I hit this assert several times. However it is very hard to reproduce it with a minimal example, and hard to come up with a test case. I could not identify any issue with the checkers themselves, and I think it is ok to cache out at this point of execution, when the node was created by a checker. 

http://reviews.llvm.org/D12818

Files:
  lib/StaticAnalyzer/Core/ExprEngineObjC.cpp

Index: lib/StaticAnalyzer/Core/ExprEngineObjC.cpp
===================================================================
--- lib/StaticAnalyzer/Core/ExprEngineObjC.cpp
+++ lib/StaticAnalyzer/Core/ExprEngineObjC.cpp
@@ -186,8 +186,11 @@
 
         // Generate a transition to non-Nil state.
         if (notNilState != State) {
+          bool HasTag = Pred->getLocation().getTag();
           Pred = Bldr.generateNode(ME, Pred, notNilState);
-          assert(Pred && "Should have cached out already!");
+          assert((Pred || HasTag) && "Should have cached out already!");
+          if (!Pred)
+            continue;
         }
       }
     } else {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12818.34579.patch
Type: text/x-patch
Size: 654 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150911/220b7cbc/attachment.bin>


More information about the cfe-commits mailing list