Fix for br937.

When writing a string value, vpi_put_value cannot assume the target vector
is a multiple of 8 bits wide.
This commit is contained in:
Martin Whitaker 2013-09-28 17:17:38 +01:00
parent 68db6c5a65
commit 34643d9628
1 changed files with 1 additions and 1 deletions

View File

@ -760,7 +760,7 @@ static vvp_vector4_t from_stringval(const char*str, unsigned wid)
unsigned byte = *--cp;
int bit;
for (bit = 0 ; bit < 8 ; bit += 1) {
for (bit = 0 ; (bit < 8) && (idx < wid) ; bit += 1) {
if (byte & 1)
val.set_bit(idx, BIT4_1);