Enhance GRBranchNodeBuilderImpl (part of GRCoreEngine) to understand the case
where the true or false CFGBlock* for a branch could be NULL. This will handle
the case where we can determine during CFG construction that a branch is
infeasible.
llvm-svn: 76450
diff --git a/clang/lib/Analysis/GRCoreEngine.cpp b/clang/lib/Analysis/GRCoreEngine.cpp
index d55bf6d..5641baa 100644
--- a/clang/lib/Analysis/GRCoreEngine.cpp
+++ b/clang/lib/Analysis/GRCoreEngine.cpp
@@ -452,7 +452,12 @@
}
ExplodedNodeImpl* GRBranchNodeBuilderImpl::generateNodeImpl(const void* State,
- bool branch) {
+ bool branch) {
+
+ // If the branch has been marked infeasible we should not generate a node.
+ if (!isFeasible(branch))
+ return NULL;
+
bool IsNew;
ExplodedNodeImpl* Succ =
@@ -460,8 +465,10 @@
Succ->addPredecessor(Pred);
- if (branch) GeneratedTrue = true;
- else GeneratedFalse = true;
+ if (branch)
+ GeneratedTrue = true;
+ else
+ GeneratedFalse = true;
if (IsNew) {
Deferred.push_back(Succ);