mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-12 20:18:20 +00:00
Fixed iterator invalidation bug in "rename" command
This commit is contained in:
parent
139648554d
commit
f889e3d385
|
@ -34,9 +34,10 @@ static void rename_in_module(RTLIL::Module *module, std::string from_name, std::
|
||||||
|
|
||||||
for (auto &it : module->wires_)
|
for (auto &it : module->wires_)
|
||||||
if (it.first == from_name) {
|
if (it.first == from_name) {
|
||||||
log("Renaming wire %s to %s in module %s.\n", log_id(it.second), log_id(to_name), log_id(module));
|
Wire *w = it.second;
|
||||||
module->rename(it.second, to_name);
|
log("Renaming wire %s to %s in module %s.\n", log_id(w), log_id(to_name), log_id(module));
|
||||||
if (it.second->port_id)
|
module->rename(w, to_name);
|
||||||
|
if (w->port_id)
|
||||||
module->fixup_ports();
|
module->fixup_ports();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue