Only process the first 32 bits of the part select base.

When reading from thread space only read the first 32 bits
(sizeof int) for the part select base. This matches the other
parts of the PV_get_base() code.
(cherry picked from commit c82baa2793)
This commit is contained in:
Cary R 2009-09-17 14:28:49 -07:00 committed by Stephen Williams
parent d0a45ffe9d
commit fb01245501
1 changed files with 2 additions and 1 deletions

View File

@ -1008,7 +1008,8 @@ static int PV_get_base(struct __vpiPV*rfp)
/* Get the value from thread space. */
int tval = 0;
for (unsigned idx = 0 ; idx < rfp->twid ; idx += 1) {
for (unsigned idx = 0 ; (idx < rfp->twid) && (idx < 8*sizeof(tval));
idx += 1) {
vvp_bit4_t bit = vthread_get_bit(vpip_current_vthread,
rfp->tbase + idx);
switch (bit) {