diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclUtil.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c index e90477f..9557aac 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -3585,16 +3585,7 @@ TclGetIntForIndex( * be converted to one, use it. */ - Tcl_WideInt value = endValue + objPtr->internalRep.wideValue; - if (endValue > 0 && value < objPtr->internalRep.wideValue) { - *indexPtr = INT_MAX; /* numerical overflow */ - } else if (value < INT_MIN || (endValue < 0 && value > objPtr->internalRep.wideValue)) { - *indexPtr = INT_MIN; /* numerical underflow or value < INT_MIN */ - } else if (value > INT_MAX) { - *indexPtr = INT_MAX;/* value > INT_MAX */ - } else { - *indexPtr = (int) value; - } + *indexPtr = endValue + (int)objPtr->internalRep.wideValue; return TCL_OK; } |