summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-01-19 14:21:38 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-01-19 14:21:38 (GMT)
commitb97786c85dbd70fd4445f8161b205d5dbc56e844 (patch)
tree760624c6455c9e79c467ad014b0059a0dd483db5
parentd0b286927306af8bde7031529ad180eaa07dcc73 (diff)
downloadtcl-b97786c85dbd70fd4445f8161b205d5dbc56e844.zip
tcl-b97786c85dbd70fd4445f8161b205d5dbc56e844.tar.gz
tcl-b97786c85dbd70fd4445f8161b205d5dbc56e844.tar.bz2
(partial) fix for [https://core.tcl-lang.org/tk/tktview?name=a9929f112a|a9929f112a]. WIP
-rw-r--r--generic/tclUtil.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 32721f6..86b6369 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -3647,12 +3647,15 @@ 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)) ? WIDE_MIN : WIDE_MAX);
+ *widePtr = ((mp_isneg((mp_int *)cd)) ? -1 : WIDE_MAX);
return TCL_OK;
}
}