Correct fix for GitHub issue 19.

This commit is contained in:
Martin Whitaker 2014-05-20 00:08:03 +01:00
parent 020e280a98
commit b7b77b2e75
1 changed files with 4 additions and 2 deletions

View File

@ -1713,8 +1713,10 @@ template <class T> bool vector4_to_value(const vvp_vector4_t&vec, T&val)
break;
case BIT4_1:
// On overflow, return the maximum value of type T
if (msk == 0) return ~msk;
res |= msk;
if (msk == 0)
res = ~msk;
else
res |= msk;
break;
default:
return false;