r344322 - [analyzer] Fix a bug in unexplored_first_location_queue iteration order.

George Karpenkov via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 11 17:52:13 PDT 2018


Author: george.karpenkov
Date: Thu Oct 11 17:52:13 2018
New Revision: 344322

URL: http://llvm.org/viewvc/llvm-project?rev=344322&view=rev
Log:
[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

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/WorkList.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Core/WorkList.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/WorkList.cpp?rev=344322&r1=344321&r2=344322&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/WorkList.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/WorkList.cpp Thu Oct 11 17:52:13 2018
@@ -255,7 +255,7 @@ std::unique_ptr<WorkList> WorkList::make
 
 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<BlockEntrance>())
-      NumVisited = NumReached[BE->getBlock()->getBlockID()]++;
+      NumVisited = NumReached[BE->getBlock()]++;
 
     queue.push(std::make_pair(U, std::make_pair(-NumVisited, ++Counter)));
   }




More information about the cfe-commits mailing list