[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

llvm-svn: 344322
This commit is contained in:
George Karpenkov 2018-10-12 00:52:13 +00:00
parent bb4588e9c1
commit fd6ccd83cd
1 changed files with 2 additions and 2 deletions

View File

@ -255,7 +255,7 @@ std::unique_ptr<WorkList> 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<BlockEntrance>())
NumVisited = NumReached[BE->getBlock()->getBlockID()]++;
NumVisited = NumReached[BE->getBlock()]++;
queue.push(std::make_pair(U, std::make_pair(-NumVisited, ++Counter)));
}