From c365555a694a7e12f74dd012c0487aa8b8f035e8 Mon Sep 17 00:00:00 2001 From: sebres Date: Thu, 4 Oct 2018 08:04:08 +0000 Subject: fixed TclGetWideBitsFromObj - minus applied to unsigned type --- generic/tclObj.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/generic/tclObj.c b/generic/tclObj.c index d1af60d..693f7c9 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -3158,10 +3158,7 @@ TclGetWideBitsFromObj( while (numBytes-- > 0) { value = (value << CHAR_BIT) | *bytes++; } - if (big.sign) { - value = -value; - } - *wideIntPtr = (Tcl_WideInt) value; + *wideIntPtr = !big.sign ? (Tcl_WideInt)value : -(Tcl_WideInt)value; mp_clear(&big); return TCL_OK; } -- cgit v0.12