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 {
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 {
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits