[Consider merging] avoid a memory corruption issue in Netlist::flatten

This commit is contained in:
klayoutmatthias 2022-07-25 22:03:01 +02:00
parent 167bcbcc5f
commit da398e77fd
1 changed files with 2 additions and 0 deletions

View File

@ -505,6 +505,8 @@ void Netlist::flatten_circuit (Circuit *circuit)
void Netlist::flatten ()
{
db::NetlistLocker locker (this);
std::set<db::Circuit *> top_circuits;
size_t ntop = top_circuit_count ();
for (db::Netlist::top_down_circuit_iterator tc = begin_top_down (); tc != end_top_down () && ntop > 0; ++tc) {