This is another fallout from the refactoring. We were
calling MarkAsSink on a cached out node.
(Fixes radar://
10376675)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143516
91177308-0d34-0410-b5e6-
96231b3b80d8
const CFGBlock *dstT, const CFGBlock *dstF)
: NodeBuilder(SrcNode, DstSet, C), DstT(dstT), DstF(dstF),
InFeasibleTrue(!DstT), InFeasibleFalse(!DstF) {
- // The Banch node builder does not generate autotransitions.
+ // The branch node builder does not generate autotransitions.
// If there are no successors it means that both branches are infeasible.
takeNodes(SrcNode);
}
void clear() { Impl.clear(); }
void insert(const ExplodedNodeSet &S) {
+ assert(&S != this);
if (empty())
Impl = S.Impl;
else
ExplodedNode *N = C.Eng.G->getNode(Loc, State, &IsNew);
N->addPredecessor(FromN, *C.Eng.G);
Frontier.erase(FromN);
+ assert(IsNew || N->isSink() == MarkAsSink);
+
+ if (!IsNew)
+ return 0;
if (MarkAsSink)
N->markAsSink();
-
- if (IsNew && !MarkAsSink)
+ else
Frontier.Add(N);
- return (IsNew ? N : 0);
+ return N;
}
StmtNodeBuilder::~StmtNodeBuilder() {
return 0;
}
+/* Caching out on a sink node. */
+extern int fooR10376675();
+extern int* bazR10376675();
+extern int nR10376675;
+void barR10376675(int *x) {
+ int *pm;
+ if (nR10376675 * 2) {
+ int *pk = bazR10376675();
+ pm = pk; //expected-warning {{never read}}
+ }
+ do {
+ *x = fooR10376675();
+ } while (0);
+}