From 6ca53c6810e21b949e9dcc317b50a57d56f73074 Mon Sep 17 00:00:00 2001 From: Larry Doolittle Date: Wed, 9 Apr 2008 21:09:55 -0700 Subject: [PATCH] Don't crash on duplicate module Fix for pr1938138, pform.cc:278: failed assertion lexical_scope == 0 --- pform.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pform.cc b/pform.cc index 1c7d72d98..91fbd1cb8 100644 --- a/pform.cc +++ b/pform.cc @@ -350,8 +350,8 @@ void pform_endmodule(const char*name) msg << "Module " << name << " was already declared here: " << (*test).second->get_fileline() << endl; VLerror(msg.str().c_str()); - pform_cur_module = 0; - return; + } else { + pform_modules[mod_name] = pform_cur_module; } // The current lexical scope should be this module by now, and @@ -360,7 +360,6 @@ void pform_endmodule(const char*name) lexical_scope = pform_cur_module->pscope_parent(); ivl_assert(*pform_cur_module, lexical_scope == 0); - pform_modules[mod_name] = pform_cur_module; pform_cur_module = 0; }