1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

[Automaton] Fix invalid iterator reference

Found by the expensive checks bot.

llvm-svn: 373763
This commit is contained in:
James Molloy 2019-10-04 17:15:30 +00:00
parent decbb4311a
commit 44be9345c9

View File

@ -94,9 +94,8 @@ private:
// Iterate over all existing heads. We will mutate the Heads deque during
// iteration.
unsigned NumHeads = Heads.size();
for (auto HeadI = Heads.begin(), HeadE = std::next(Heads.begin(), NumHeads);
HeadI != HeadE; ++HeadI) {
PathSegment *Head = *HeadI;
for (unsigned I = 0; I < NumHeads; ++I) {
PathSegment *Head = Heads[I];
// The sequence of pairs is sorted. Select the set of pairs that
// transition from the current head state.
auto PI = lower_bound(Pairs, NfaStatePair{Head->State, 0ULL});