3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-23 19:47:55 +00:00

Fixed handling of constant-true branches in proc_clean

This commit is contained in:
Clifford Wolf 2014-08-12 17:35:22 +02:00
parent 1dd8252169
commit 9d353fc543
2 changed files with 3 additions and 2 deletions

View file

@ -59,7 +59,8 @@ void proc_clean_switch(RTLIL::SwitchRule *sw, RTLIL::CaseRule *parent, bool &did
sw->signal = RTLIL::SigSpec();
}
if (sw->cases.size() == 1 && (sw->signal.size() == 0 || sw->cases[0]->compare.empty()))
if (parent->switches.front() == sw && sw->cases.size() == 1 &&
(sw->signal.size() == 0 || sw->cases[0]->compare.empty()))
{
did_something = true;
for (auto &action : sw->cases[0]->actions)