diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-08-19 09:33:34 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-08-19 09:33:34 (GMT) |
commit | e588745d77e39a04cd197b6ee4539ae5b8811256 (patch) | |
tree | 715ca8abc4170c7ae9fa01a174a931322f45a6f1 /generic/tclObj.c | |
parent | b3993adcfb19f12c2fe6accbaec020a9599a6294 (diff) | |
parent | b3fc99501ec94bdc4c05736825c08a050cf8046d (diff) | |
download | tcl-e588745d77e39a04cd197b6ee4539ae5b8811256.zip tcl-e588745d77e39a04cd197b6ee4539ae5b8811256.tar.gz tcl-e588745d77e39a04cd197b6ee4539ae5b8811256.tar.bz2 |
Re-base branch "all-wideint" to core-8-branch. Still WIP
Diffstat (limited to 'generic/tclObj.c')
-rw-r--r-- | generic/tclObj.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclObj.c b/generic/tclObj.c index 16ef7c3..b1e4b29 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -2516,7 +2516,7 @@ Tcl_GetIntFromObj( if (TclGetLongFromObj(interp, objPtr, &l) != TCL_OK) { return TCL_ERROR; } - if ((ULONG_MAX > UINT_MAX) && ((l > UINT_MAX) || (l < -(long)UINT_MAX))) { + if ((ULONG_MAX > UINT_MAX) && ((l > (long)(UINT_MAX)) || (l < (long)(INT_MIN)))) { if (interp != NULL) { const char *s = "integer value too large to represent as non-long integer"; @@ -2796,7 +2796,7 @@ Tcl_GetLongFromObj( #else if (objPtr->typePtr == &tclIntType) { /* - * We return any integer in the range -ULONG_MAX to ULONG_MAX + * We return any integer in the range LONG_MIN to ULONG_MAX * converted to a long, ignoring overflow. The rule preserves * existing semantics for conversion of integers on input, but * avoids inadvertent demotion of wide integers to 32-bit ones in @@ -2805,7 +2805,7 @@ Tcl_GetLongFromObj( Tcl_WideInt w = objPtr->internalRep.wideValue; - if (w >= -(Tcl_WideInt)(ULONG_MAX) + if (w >= (Tcl_WideInt)(LONG_MIN) && w <= (Tcl_WideInt)(ULONG_MAX)) { *longPtr = Tcl_WideAsLong(w); return TCL_OK; |