diff options
| author | James Molloy <jmolloy@google.com> | 2019-10-04 17:15:30 +0000 |
|---|---|---|
| committer | James Molloy <jmolloy@google.com> | 2019-10-04 17:15:30 +0000 |
| commit | 717e540f7ea13eb73707b76bf9062a1704fc68b9 (patch) | |
| tree | ba3520b585cfb7765c7aaad00ead92b9d4f98f1c | |
| parent | 9baac83a2e714962baafd20d9e29aef9dd21a4f5 (diff) | |
| download | bcm5719-llvm-717e540f7ea13eb73707b76bf9062a1704fc68b9.tar.gz bcm5719-llvm-717e540f7ea13eb73707b76bf9062a1704fc68b9.zip | |
[Automaton] Fix invalid iterator reference
Found by the expensive checks bot.
llvm-svn: 373763
| -rw-r--r-- | llvm/include/llvm/Support/Automaton.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/include/llvm/Support/Automaton.h b/llvm/include/llvm/Support/Automaton.h index 38ab92fe639..5fe0824017d 100644 --- a/llvm/include/llvm/Support/Automaton.h +++ b/llvm/include/llvm/Support/Automaton.h @@ -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}); |

