From fb012455014aa3846ae81bf0902be929636c93f4 Mon Sep 17 00:00:00 2001 From: Cary R Date: Thu, 17 Sep 2009 14:28:49 -0700 Subject: [PATCH] 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 c82baa2793c53f2b185c4dbe4fd41d619ffb7af6) --- vvp/vpi_signal.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vvp/vpi_signal.cc b/vvp/vpi_signal.cc index 5e33f2846..febcef59f 100644 --- a/vvp/vpi_signal.cc +++ b/vvp/vpi_signal.cc @@ -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) {