From 55e5bd4213c8065994fb916e72105d822bd4175a Mon Sep 17 00:00:00 2001 From: Dan Ravensloft Date: Fri, 5 Mar 2021 21:45:11 +0000 Subject: [PATCH] Replace assert in addModule with more useful error message --- kernel/rtlil.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 1faf376e7..40079ffc5 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -613,7 +613,8 @@ void RTLIL::Design::add(RTLIL::Module *module) 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); RTLIL::Module *module = new RTLIL::Module; -- 2.30.2