From b7b77b2e75ec5726769def1c95489f316f50d82c Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Tue, 20 May 2014 00:08:03 +0100 Subject: [PATCH] Correct fix for GitHub issue 19. --- vvp/vvp_net.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vvp/vvp_net.cc b/vvp/vvp_net.cc index aaf8f0203..0c29fa4b6 100644 --- a/vvp/vvp_net.cc +++ b/vvp/vvp_net.cc @@ -1713,8 +1713,10 @@ template 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;