From 5dc420292989e6e5c885db7fad906560968f0131 Mon Sep 17 00:00:00 2001 From: Cary R Date: Wed, 19 Dec 2007 14:12:34 -0800 Subject: [PATCH] V0.8: Back port development patch for pr1716276 This is a straight back port of the development patch for the problem reported in pr1716276. This was causing the test case to core dump under stable. --- elab_scope.cc | 3 +++ pform_dump.cc | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/elab_scope.cc b/elab_scope.cc index d550340c4..e6d61de76 100644 --- a/elab_scope.cc +++ b/elab_scope.cc @@ -432,6 +432,9 @@ void PGModule::elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const ; cur != replace.end() ; cur ++ ) { PExpr*tmp = (*cur).second; + // No expression means that the parameter is not + // replaced at all. + if (tmp == 0) continue; NetExpr*val = tmp->elaborate_pexpr(des, sc); bool flag = my_scope->replace_parameter((*cur).first, val); if (! flag) { diff --git a/pform_dump.cc b/pform_dump.cc index ed35bb791..ae17d6297 100644 --- a/pform_dump.cc +++ b/pform_dump.cc @@ -360,10 +360,14 @@ void PGModule::dump(ostream&out) const out << " " << type_ << " "; // If parameters are overridden by order, dump them. - if (overrides_) { + if (overrides_ && overrides_->count() > 0) { assert(parms_ == 0); out << "#("; - out << *((*overrides_)[0]); + + if ((*overrides_)[0] == 0) + out << ""; + else + out << *((*overrides_)[0]); for (unsigned idx = 1 ; idx < overrides_->count() ; idx += 1) { out << "," << *((*overrides_)[idx]); }