From 714ca3542d06cd01ece501f94cc4501cffe10884 Mon Sep 17 00:00:00 2001 From: steve Date: Wed, 24 Apr 2002 02:47:02 +0000 Subject: [PATCH] Fix compile time eval of signed <= signed. --- eval_tree.cc | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/eval_tree.cc b/eval_tree.cc index cda95950b..339cdf59f 100644 --- a/eval_tree.cc +++ b/eval_tree.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_tree.cc,v 1.34 2002/04/14 19:28:47 steve Exp $" +#ident "$Id: eval_tree.cc,v 1.35 2002/04/24 02:47:02 steve Exp $" #endif # include "config.h" @@ -235,6 +235,7 @@ NetEConst* NetEBComp::eval_leeq_() return new NetEConst(result); } + /* Detect the case where the right side is greater that or equal to the largest value the left side can possibly have. */ @@ -254,14 +255,16 @@ NetEConst* NetEBComp::eval_leeq_() return new NetEConst(result); } - if (lv.has_sign() && rv.has_sign() && (lv.as_long() <= rv.as_long())) { - verinum result(verinum::V1, 1); - return new NetEConst(result); - } - - if (lv.as_ulong() <= rv.as_ulong()) { - verinum result(verinum::V1, 1); - return new NetEConst(result); + if (lv.has_sign() && rv.has_sign()) { + if (lv.as_long() <= rv.as_long()) { + verinum result(verinum::V1, 1); + return new NetEConst(result); + } + } else { + if (lv.as_ulong() <= rv.as_ulong()) { + verinum result(verinum::V1, 1); + return new NetEConst(result); + } } verinum result(verinum::V0, 1); @@ -1065,6 +1068,9 @@ NetEConst* NetEUReduce::eval_tree() /* * $Log: eval_tree.cc,v $ + * Revision 1.35 2002/04/24 02:47:02 steve + * Fix compile time eval of signed <= signed. + * * Revision 1.34 2002/04/14 19:28:47 steve * Fix constant evaluation of unary *