forked from jasder/antlr
vector::erase invalidates any iterators at/after the erase position
This commit is contained in:
parent
6de938dbf7
commit
ba5cf0060c
|
@ -128,7 +128,7 @@ void IntervalSet::add(const Interval &addition) {
|
|||
}
|
||||
|
||||
// if we bump up against or overlap next, merge
|
||||
_intervals.erase(iterator);// remove this one
|
||||
iterator = _intervals.erase(iterator);// remove this one
|
||||
--iterator; // move backwards to what we just set
|
||||
*iterator = bigger.Union(next); // set to 3 merged ones
|
||||
// ml: no need to advance iterator, we do that in the next round anyway. ++iterator; // first call to next after previous duplicates the result
|
||||
|
|
Loading…
Reference in New Issue