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.
This commit is contained in:
Cary R 2007-12-19 14:12:34 -08:00 committed by Stephen Williams
parent 281b4edbab
commit 5dc4202929
2 changed files with 9 additions and 2 deletions

View File

@ -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) {

View File

@ -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 << "<nil>";
else
out << *((*overrides_)[0]);
for (unsigned idx = 1 ; idx < overrides_->count() ; idx += 1) {
out << "," << *((*overrides_)[idx]);
}