Fix compile time eval of signed <= signed.

This commit is contained in:
steve 2002-04-24 02:47:02 +00:00
parent 7e27217dac
commit 714ca3542d
1 changed files with 15 additions and 9 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #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 #endif
# include "config.h" # include "config.h"
@ -235,6 +235,7 @@ NetEConst* NetEBComp::eval_leeq_()
return new NetEConst(result); return new NetEConst(result);
} }
/* Detect the case where the right side is greater that or /* Detect the case where the right side is greater that or
equal to the largest value the left side can possibly equal to the largest value the left side can possibly
have. */ have. */
@ -254,14 +255,16 @@ NetEConst* NetEBComp::eval_leeq_()
return new NetEConst(result); return new NetEConst(result);
} }
if (lv.has_sign() && rv.has_sign() && (lv.as_long() <= rv.as_long())) { if (lv.has_sign() && rv.has_sign()) {
verinum result(verinum::V1, 1); if (lv.as_long() <= rv.as_long()) {
return new NetEConst(result); verinum result(verinum::V1, 1);
} return new NetEConst(result);
}
if (lv.as_ulong() <= rv.as_ulong()) { } else {
verinum result(verinum::V1, 1); if (lv.as_ulong() <= rv.as_ulong()) {
return new NetEConst(result); verinum result(verinum::V1, 1);
return new NetEConst(result);
}
} }
verinum result(verinum::V0, 1); verinum result(verinum::V0, 1);
@ -1065,6 +1068,9 @@ NetEConst* NetEUReduce::eval_tree()
/* /*
* $Log: eval_tree.cc,v $ * $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 * Revision 1.34 2002/04/14 19:28:47 steve
* Fix constant evaluation of unary * Fix constant evaluation of unary
* *