From 6173e6b78a78878025df6dc5b9feebf3c7c5d5b2 Mon Sep 17 00:00:00 2001 From: steve Date: Thu, 6 Jun 2002 18:57:04 +0000 Subject: [PATCH] Better error for identifier index eval. --- eval.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/eval.cc b/eval.cc index 77b005872..94771efbf 100644 --- a/eval.cc +++ b/eval.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: eval.cc,v 1.27 2002/05/23 03:08:51 steve Exp $" +#ident "$Id: eval.cc,v 1.28 2002/06/06 18:57:04 steve Exp $" #endif # include "config.h" @@ -142,6 +142,14 @@ verinum* PEIdent::eval_const(const Design*des, const NetScope*scope) const if (expr == 0) return 0; + if (msb_ != 0) { + cerr << get_line() << ": internal error: unexpected index " + << "to " << path_ << " in scope " << scope->name() << endl; + cerr << get_line() << ": : expression is: " + << *msb_ << endl; + return 0; + } + assert(msb_ == 0); if (dynamic_cast(expr)) { @@ -222,6 +230,9 @@ verinum* PEUnary::eval_const(const Design*des, const NetScope*scope) const /* * $Log: eval.cc,v $ + * Revision 1.28 2002/06/06 18:57:04 steve + * Better error for identifier index eval. + * * Revision 1.27 2002/05/23 03:08:51 steve * Add language support for Verilog-2001 attribute * syntax. Hook this support into existing $attribute