diff --git a/elab_expr.cc b/elab_expr.cc index 336cdb60b..037b04da2 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -428,6 +428,13 @@ NetExpr* PEConcat::elaborate_expr(Design*des, NetScope*scope, bool) const des->errors += 1; } + if (!rep->value().is_defined()) { + cerr << get_line() << ": error: Concatenation repeat " + << "may not be undefined (" << rep->value() + << ")." << endl; + des->errors += 1; + } + repeat = rep; } diff --git a/elab_net.cc b/elab_net.cc index 6e443b923..098e3f7a7 100644 --- a/elab_net.cc +++ b/elab_net.cc @@ -1341,6 +1341,14 @@ NetNet* PEConcat::elaborate_net(Design*des, NetScope*scope, des->errors += 1; return 0; } + + if (!erep->value().is_defined()) { + cerr << get_line() << ": error: Concatenation repeat " + << "may not be undefined (" << erep->value() + << ")." << endl; + des->errors += 1; + return 0; + } } /* The operands of the concatenation must contain all