Overcautious assert in shift is removed.

This commit is contained in:
steve 2000-05-18 20:23:40 +00:00
parent 0f13af2ea1
commit 38b4de87ad
1 changed files with 6 additions and 3 deletions

View File

@ -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.
*