summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kernel/rtlil.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index ec4375f2..6556b82e 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -1148,6 +1148,9 @@ void RTLIL::Module::remove(const std::set<RTLIL::Wire*> &wires)
void RTLIL::Module::remove(RTLIL::Cell *cell)
{
+ while (!cell->connections_.empty())
+ cell->unsetPort(cell->connections_.begin()->first);
+
log_assert(cells_.count(cell->name) != 0);
log_assert(refcount_cells_ == 0);
cells_.erase(cell->name);