fix invalid iterator handling, reported by -D_GLIBCXX_DEBUG

* spot/tl/unabbrev.cc, spot/twa/twagraph.cc,
spot/twaalgos/complement.cc: Here.  All of these caused
test suite failure with -D_GLIBCXX_DEBUG.
This commit is contained in:
Alexandre Duret-Lutz 2020-04-14 23:24:13 +02:00
parent 4d2922eafa
commit 306eca8ce1
3 changed files with 23 additions and 18 deletions

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2015, 2018-2019 Laboratoire de Recherche et
// Copyright (C) 2015, 2018-2020 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
@ -276,7 +276,9 @@ namespace spot
break;
}
}
return entry.first->second = out;
// The recursion may have invalidated the "entry" iterator, so do
// not reuse it.
return cache_[in] = out;
}
formula unabbreviate(formula in, const char* opt)