mirror of https://github.com/YosysHQ/yosys.git
Merge pull request #1927 from YosysHQ/eddie/design_remove_assert
kernel: Design::remove(RTLIL::Module *) to check refcount_modules_
This commit is contained in:
commit
aa552cefa3
|
@ -597,6 +597,7 @@ void RTLIL::Design::remove(RTLIL::Module *module)
|
|||
}
|
||||
|
||||
log_assert(modules_.at(module->name) == module);
|
||||
log_assert(refcount_modules_ == 0);
|
||||
modules_.erase(module->name);
|
||||
delete module;
|
||||
}
|
||||
|
|
|
@ -340,7 +340,7 @@ struct DesignPass : public Pass {
|
|||
|
||||
if (reset_mode || !load_name.empty() || push_mode || pop_mode)
|
||||
{
|
||||
for (auto mod : design->modules())
|
||||
for (auto mod : design->modules().to_vector())
|
||||
design->remove(mod);
|
||||
|
||||
design->selection_stack.clear();
|
||||
|
|
Loading…
Reference in New Issue