summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r--generic/tclUtil.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 86b6369..10153fb 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -3647,15 +3647,12 @@ GetWideForIndex(
if (numType == TCL_NUMBER_INT) {
/* objPtr holds an integer in the signed wide range */
*widePtr = *(Tcl_WideInt *)cd;
- if (*widePtr < -1) {
- *widePtr = -1;
- }
return TCL_OK;
}
if (numType == TCL_NUMBER_BIG) {
/* objPtr holds an integer outside the signed wide range */
/* Truncate to the signed wide range. */
- *widePtr = ((mp_isneg((mp_int *)cd)) ? -1 : WIDE_MAX);
+ *widePtr = ((mp_isneg((mp_int *)cd)) ? WIDE_MIN : WIDE_MAX);
return TCL_OK;
}
}
@@ -3706,7 +3703,7 @@ Tcl_GetIntForIndex(
return TCL_ERROR;
}
if (indexPtr != NULL) {
- if ((wide < 0) && (endValue > TCL_INDEX_END)) {
+ if ((wide < 0) && (endValue >= 0)) {
*indexPtr = -1;
} else if (wide > INT_MAX) {
*indexPtr = INT_MAX;