From 4fed9d653238ff04b1ee0edd9c3ce47a638b38de Mon Sep 17 00:00:00 2001 From: steve Date: Fri, 7 Jun 2002 02:57:54 +0000 Subject: [PATCH] Simply give up on constants with indices. --- eval.cc | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/eval.cc b/eval.cc index 94771efbf..5e624894b 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.28 2002/06/06 18:57:04 steve Exp $" +#ident "$Id: eval.cc,v 1.29 2002/06/07 02:57:54 steve Exp $" #endif # include "config.h" @@ -142,24 +142,13 @@ 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)) { - cerr << get_line() << ": sorry: I cannot evaluate ``" << - path_ << "'' in this scope: " << scope->name() << endl; - return 0; - } - const NetEConst*eval = dynamic_cast(expr); assert(eval); + + if (msb_ || lsb_) + return 0; + + return new verinum(eval->value()); } @@ -230,6 +219,9 @@ verinum* PEUnary::eval_const(const Design*des, const NetScope*scope) const /* * $Log: eval.cc,v $ + * Revision 1.29 2002/06/07 02:57:54 steve + * Simply give up on constants with indices. + * * Revision 1.28 2002/06/06 18:57:04 steve * Better error for identifier index eval. *