From 8abf3037537f4a882fd5fbe5d1652e0149888bed Mon Sep 17 00:00:00 2001 From: Cary R Date: Tue, 13 Oct 2009 17:43:00 -0700 Subject: [PATCH] Don't replace parameter overrides that did not evaluate. Trying to replace a parameter override that did not evaluate correctly can lead to a crash, so just skip the substitution. --- elab_scope.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/elab_scope.cc b/elab_scope.cc index 86d6b81e8..f4f54f541 100644 --- a/elab_scope.cc +++ b/elab_scope.cc @@ -216,7 +216,7 @@ static void replace_scope_parameters_(NetScope*scope, const LineInfo&loc, if (val == 0) { cerr << loc.get_fileline() << ": internal error: " << "Missing expression in parameter replacement for " - << (*cur).first; + << (*cur).first << endl;; } assert(val); if (debug_scopes) { @@ -1358,9 +1358,9 @@ void PGModule::elaborate_scope_mod_instances_(Design*des, Module*mod, NetScope*s PExpr*tmp = (*cur).second; // No expression means that the parameter is not // replaced at all. - if (tmp == 0) - continue; + if (tmp == 0) continue; NetExpr*val = tmp->elaborate_pexpr(des, sc); + if (val == 0) continue; replace_net[(*cur).first] = val; }