summaryrefslogtreecommitdiff
path: root/passes/opt/opt_const.cc
diff options
context:
space:
mode:
Diffstat (limited to 'passes/opt/opt_const.cc')
-rw-r--r--passes/opt/opt_const.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/passes/opt/opt_const.cc b/passes/opt/opt_const.cc
index 0effd964..7c82f0fc 100644
--- a/passes/opt/opt_const.cc
+++ b/passes/opt/opt_const.cc
@@ -181,8 +181,10 @@ void replace_const_cells(RTLIL::Design *design, RTLIL::Module *module)
RTLIL::SigSpec b = assign_map(cell->connections["\\B"]);
if (a.is_fully_const()) {
- RTLIL::SigSpec tmp = a;
- a = b, b = tmp;
+ RTLIL::SigSpec tmp;
+ tmp = a, a = b, b = tmp;
+ cell->connections["\\A"] = a;
+ cell->connections["\\B"] = b;
}
if (b.is_fully_const()) {