From: Luke Kenneth Casson Leighton Date: Thu, 20 Feb 2020 20:06:25 +0000 (+0000) Subject: stop at end of mask index X-Git-Tag: ls180-24jan2020~137 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f5a83863e86192b1a9a47ea84eb95d4dbbdb9dd6;p=ieee754fpu.git stop at end of mask index --- diff --git a/src/ieee754/part_mul_add/partpoints.py b/src/ieee754/part_mul_add/partpoints.py index efc55e41..e138490b 100644 --- a/src/ieee754/part_mul_add/partpoints.py +++ b/src/ieee754/part_mul_add/partpoints.py @@ -18,7 +18,7 @@ def make_partition(mask, width): mlen = mask.shape()[0] ppos = mlen midx = 0 - while ppos < width-1: # -1, ignore last bit + while ppos < width and midx < mlen: # -1, ignore last bit ppoints[ppos] = mask[midx] ppos += mlen midx += 1