From 38b4de87ad7136dfaf7a2b37702ba360377a61b6 Mon Sep 17 00:00:00 2001 From: steve Date: Thu, 18 May 2000 20:23:40 +0000 Subject: [PATCH] Overcautious assert in shift is removed. --- vvm/vvm_func.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vvm/vvm_func.cc b/vvm/vvm_func.cc index 094720eb5..3f2319682 100644 --- a/vvm/vvm_func.cc +++ b/vvm/vvm_func.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) && !defined(macintosh) -#ident "$Id: vvm_func.cc,v 1.8 2000/04/29 01:19:47 steve Exp $" +#ident "$Id: vvm_func.cc,v 1.9 2000/05/18 20:23:40 steve Exp $" #endif # include "vvm_func.h" @@ -149,7 +149,7 @@ void vvm_binop_shiftl(vvm_bitset_t&v, const vvm_bitset_t&l, const vvm_bitset_t&r) { - assert(v.nbits == l.nbits); + assert(v.nbits <= l.nbits); vvm_u32 s = r.as_unsigned(); for (unsigned idx = 0 ; idx < v.nbits; idx += 1) v[idx] = (idx < s) ? St0 : l[idx-s]; @@ -159,8 +159,8 @@ void vvm_binop_shiftr(vvm_bitset_t&v, const vvm_bitset_t&l, const vvm_bitset_t&r) { - assert(v.nbits == l.nbits); vvm_u32 s = r.as_unsigned(); + for (unsigned idx = 0 ; idx < v.nbits ; idx += 1) v[idx] = ((idx+s) < l.nbits) ? l[idx+s] : St0; } @@ -496,6 +496,9 @@ void vvm_ternary(vvm_bitset_t&v, vpip_bit_t c, /* * $Log: vvm_func.cc,v $ + * Revision 1.9 2000/05/18 20:23:40 steve + * Overcautious assert in shift is removed. + * * Revision 1.8 2000/04/29 01:19:47 steve * Proper bounds checking of the left operator of right shift. *