Merge pull request #3812 from charlottia/iterator-invalidation

proc_prune: avoid using invalidated iterator
This commit is contained in:
Claire Xen 2023-06-21 14:46:25 +02:00 committed by GitHub
commit 51e627686a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -91,7 +91,7 @@ struct PruneWorker
if (GetSize(new_lhs) == 0) {
if (GetSize(conn_lhs) == 0)
removed_count++;
cs->actions.erase((it++).base() - 1);
it = decltype(cs->actions)::reverse_iterator(cs->actions.erase(it.base() - 1));
} else {
it->first = new_lhs;
it->second = new_rhs;