mirror of https://github.com/YosysHQ/yosys.git
Fix memory leak when one of multiple DFF cells is removed in opt_rmdff
When there are multiple DFFs and one of them is removed, its reference lingers inside bit2driver dict. While invoking handle_dff() function for other DFFs, this broken reference is used isnside sat_import_cell() function.
This commit is contained in:
parent
0f32cb4e0a
commit
35fa7b3057
|
@ -530,6 +530,11 @@ delete_dff:
|
|||
log("Removing %s (%s) from module %s.\n", log_id(dff), log_id(dff->type), log_id(mod));
|
||||
remove_init_attr(dff->getPort("\\Q"));
|
||||
mod->remove(dff);
|
||||
|
||||
for (auto &entry : bit2driver)
|
||||
if (entry.second == dff)
|
||||
bit2driver.erase(entry.first);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue