projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ddc8044
)
opt_ffinv: Fix use after free.
author
Marcelina Kościelnicka
<mwk@0x04.net>
Mon, 13 Jun 2022 10:22:59 +0000
(12:22 +0200)
committer
Marcelina Kościelnicka
<mwk@0x04.net>
Mon, 13 Jun 2022 12:04:04 +0000
(14:04 +0200)
passes/opt/opt_ffinv.cc
patch
|
blob
|
history
diff --git
a/passes/opt/opt_ffinv.cc
b/passes/opt/opt_ffinv.cc
index fe5b59fa5c6401b1b9a331a9730f17c2258836f1..5d989dafdc0a97e59c2c9a423703b1c49dc4ec03 100644
(file)
--- a/
passes/opt/opt_ffinv.cc
+++ b/
passes/opt/opt_ffinv.cc
@@
-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;