3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-12 04:03:45 +00:00

opt_ffinv: Fix use after free.

This commit is contained in:
Marcelina Kościelnicka 2022-06-13 12:22:59 +02:00
parent ddc8044655
commit 1ff0e1a58a

View file

@ -201,10 +201,13 @@ struct OptFfInvWorker
{
log("Discovering LUTs.\n");
for (Cell *cell : module->selected_cells()) {
if (!RTLIL::builtin_ff_cell_types().count(cell->type))
continue;
std::vector<Cell *> ffs;
for (Cell *cell : module->selected_cells())
if (RTLIL::builtin_ff_cell_types().count(cell->type))
ffs.push_back(cell);
for (Cell *cell : ffs) {
FfData ff(&initvals, cell);
if (ff.has_sr)
continue;