From 4453d65072d287f82b985827be49fe265fd2660f Mon Sep 17 00:00:00 2001 From: George Karpenkov Date: Fri, 12 Oct 2018 00:52:13 +0000 Subject: [PATCH] [analyzer] Fix a bug in unexplored_first_location_queue iteration order. Pointed out by Artem in post-commit review for https://reviews.llvm.org/D53058 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344322 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/StaticAnalyzer/Core/WorkList.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/StaticAnalyzer/Core/WorkList.cpp b/lib/StaticAnalyzer/Core/WorkList.cpp index 9eb3ee87fb..e25f94f572 100644 --- a/lib/StaticAnalyzer/Core/WorkList.cpp +++ b/lib/StaticAnalyzer/Core/WorkList.cpp @@ -255,7 +255,7 @@ std::unique_ptr WorkList::makeUnexploredFirstPriorityQueue() { namespace { class UnexploredFirstPriorityLocationQueue : public WorkList { - using LocIdentifier = int; + using LocIdentifier = const CFGBlock *; // How many times each location was visited. // Is signed because we negate it later in order to have a reversed @@ -294,7 +294,7 @@ public: const ExplodedNode *N = U.getNode(); unsigned NumVisited = 0; if (auto BE = N->getLocation().getAs()) - NumVisited = NumReached[BE->getBlock()->getBlockID()]++; + NumVisited = NumReached[BE->getBlock()]++; queue.push(std::make_pair(U, std::make_pair(-NumVisited, ++Counter))); } -- 2.40.0