mirror of https://github.com/YosysHQ/yosys.git
modtools: fix use-after-free of cell pointers in ModWalker
cell_inputs and cell_outputs retain cell pointers as their keys across invocations of setup(), which may however be invalidated in the meantime (as happens in e.g. passes/opt/share.cc:1432). A later rehash of the dicts (caused by inserting in ModWalker::add_wire()) will cause them to be dereferenced.
This commit is contained in:
parent
f4298b057a
commit
3aa10e90ba
|
@ -395,6 +395,8 @@ struct ModWalker
|
|||
signal_consumers.clear();
|
||||
signal_inputs.clear();
|
||||
signal_outputs.clear();
|
||||
cell_inputs.clear();
|
||||
cell_outputs.clear();
|
||||
|
||||
for (auto &it : module->wires_)
|
||||
add_wire(it.second);
|
||||
|
|
Loading…
Reference in New Issue