From b2bdce98abc16c6301cdfcd348dfa7a8711d49f1 Mon Sep 17 00:00:00 2001 From: Cary R Date: Mon, 26 May 2008 11:14:59 -0700 Subject: [PATCH] It is an error for the concatenation repeat to be undefined. Print an error message if the concatenation repeat expression is undefined. --- elab_expr.cc | 9 +++++++++ elab_net.cc | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/elab_expr.cc b/elab_expr.cc index 90c1937fc..d452b31e4 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -716,6 +716,15 @@ NetExpr* PEConcat::elaborate_expr(Design*des, NetScope*scope, des->errors += 1; } + if (!rep->value().is_defined()) { + cerr << get_fileline() << ": error: Concatenation repeat " + << "may not be undefined (" << rep->value() + << ")." << endl; + des->errors += 1; + concat_depth -= 1; + return 0; + } + if (rep->value().is_negative()) { cerr << get_fileline() << ": error: Concatenation repeat " << "may not be negative (" << rep->value().as_long() diff --git a/elab_net.cc b/elab_net.cc index 97fcb76cd..2e9224483 100644 --- a/elab_net.cc +++ b/elab_net.cc @@ -1578,6 +1578,14 @@ NetNet* PEConcat::elaborate_net(Design*des, NetScope*scope, return 0; } + if (!erep->value().is_defined()) { + cerr << get_fileline() << ": error: Concatenation repeat " + << "may not be undefined (" << erep->value() + << ")." << endl; + des->errors += 1; + return 0; + } + if (erep->value().is_negative()) { cerr << get_fileline() << ": error: Concatenation repeat " << "may not be negative (" << erep->value().as_long()