aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorMarcelina Koƛcielnicka <mwk@0x04.net>2022-07-23 16:42:54 +0200
committerMarcelina Koƛcielnicka <mwk@0x04.net>2022-07-23 17:27:26 +0200
commitf679b756d8f9af44654132d3fd4e3a3465afea89 (patch)
tree9eb5faeced12c6ea67a55ad91cfb8c04e9ce2e19 /passes
parent7e02b6a70b824aeffcae493f99623126de6470ef (diff)
downloadyosys-f679b756d8f9af44654132d3fd4e3a3465afea89.tar.gz
yosys-f679b756d8f9af44654132d3fd4e3a3465afea89.tar.bz2
yosys-f679b756d8f9af44654132d3fd4e3a3465afea89.zip
opt_reduce: Fix use-after-free.
Fixes #3418.
Diffstat (limited to 'passes')
-rw-r--r--passes/opt/opt_reduce.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/passes/opt/opt_reduce.cc b/passes/opt/opt_reduce.cc
index 1a7c93fbd..c36a38dae 100644
--- a/passes/opt/opt_reduce.cc
+++ b/passes/opt/opt_reduce.cc
@@ -594,11 +594,9 @@ struct OptReduceWorker
if (cell->type.in(ID($mux), ID($pmux)))
opt_pmux(cell);
-
- if (cell->type == ID($bmux))
+ else if (cell->type == ID($bmux))
opt_bmux(cell);
-
- if (cell->type == ID($demux))
+ else if (cell->type == ID($demux))
opt_demux(cell);
}
}