diff options
author | Artem Dergachev <artem.dergachev@gmail.com> | 2019-10-18 20:15:29 +0000 |
---|---|---|
committer | Artem Dergachev <artem.dergachev@gmail.com> | 2019-10-18 20:15:29 +0000 |
commit | 0836645ecf90c2813830bb68ef74d8be7b67a8a2 (patch) | |
tree | d2a3bc131cc78c1e5ba30787fe848cd571e70ab8 /lib | |
parent | e43eb432de21ed58e59e9fa7514750b901396916 (diff) | |
download | clang-0836645ecf90c2813830bb68ef74d8be7b67a8a2.tar.gz |
[analyzer] Fix hidden node traversal in exploded graph dumps.
The joined nodes now actually have the same state. That was intended
from the start but the original implementation turned out to be buggy.
Differential Revision: https://reviews.llvm.org/D69150
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@375278 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/StaticAnalyzer/Core/ExprEngine.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp index 04301ba5c1..8e4e767209 100644 --- a/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -3030,22 +3030,16 @@ struct DOTGraphTraits<ExplodedGraph*> : public DefaultDOTGraphTraits { llvm::function_ref<void(const ExplodedNode *)> PreCallback, llvm::function_ref<void(const ExplodedNode *)> PostCallback, llvm::function_ref<bool(const ExplodedNode *)> Stop) { - const ExplodedNode *FirstHiddenNode = N; - while (FirstHiddenNode->pred_size() == 1 && - isNodeHidden(*FirstHiddenNode->pred_begin())) { - FirstHiddenNode = *FirstHiddenNode->pred_begin(); - } - const ExplodedNode *OtherNode = FirstHiddenNode; while (true) { - PreCallback(OtherNode); - if (Stop(OtherNode)) + PreCallback(N); + if (Stop(N)) return true; - if (OtherNode == N) + if (N->succ_size() != 1 || !isNodeHidden(N->getFirstSucc())) break; - PostCallback(OtherNode); + PostCallback(N); - OtherNode = *OtherNode->succ_begin(); + N = N->getFirstSucc(); } return false; } |