mirror of https://github.com/YosysHQ/yosys.git
Replace assert in addModule with more useful error message
This commit is contained in:
parent
9dd813374e
commit
55e5bd4213
|
@ -613,7 +613,8 @@ void RTLIL::Design::add(RTLIL::Module *module)
|
||||||
|
|
||||||
RTLIL::Module *RTLIL::Design::addModule(RTLIL::IdString name)
|
RTLIL::Module *RTLIL::Design::addModule(RTLIL::IdString name)
|
||||||
{
|
{
|
||||||
log_assert(modules_.count(name) == 0);
|
if (modules_.count(name) != 0)
|
||||||
|
log_error("Attempted to add new module named '%s', but a module by that name already exists\n", name.c_str());
|
||||||
log_assert(refcount_modules_ == 0);
|
log_assert(refcount_modules_ == 0);
|
||||||
|
|
||||||
RTLIL::Module *module = new RTLIL::Module;
|
RTLIL::Module *module = new RTLIL::Module;
|
||||||
|
|
Loading…
Reference in New Issue