diff options
| -rw-r--r-- | generic/tclDisassemble.c | 3 | ||||
| -rw-r--r-- | generic/tclUtil.c | 11 | ||||
| -rw-r--r-- | tests/util.test | 6 | ||||
| -rwxr-xr-x | unix/configure | 36 | ||||
| -rw-r--r-- | unix/tcl.m4 | 3 |
5 files changed, 3 insertions, 56 deletions
diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index c1b0e83..874d0d7 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -818,7 +818,7 @@ UpdateStringOfInstName( Tcl_Obj *objPtr) { size_t len, inst = (size_t)objPtr->internalRep.wideValue; - char *s, buf[20]; + char *s, buf[TCL_INTEGER_SPACE + 5]; if (inst > LAST_INST_OPCODE) { sprintf(buf, "inst_%" TCL_Z_MODIFIER "d", inst); @@ -827,6 +827,7 @@ UpdateStringOfInstName( s = (char *) tclInstructionTable[inst].name; } len = strlen(s); + /* assert (len < UINT_MAX) */ objPtr->bytes = ckalloc(len + 1); memcpy(objPtr->bytes, s, len + 1); objPtr->length = len; diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 988d4b5..f9b92c8 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -3335,16 +3335,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; } diff --git a/tests/util.test b/tests/util.test index 05c8ea2..9d4c57e 100644 --- a/tests/util.test +++ b/tests/util.test @@ -653,12 +653,6 @@ test util-9.43 {TclGetIntForIndex} -body { test util-9.44 {TclGetIntForIndex} -body { string index a 0+1000000000000 } -returnCodes error -match glob -result * -test util-9.45 {TclGetIntForIndex} { - string index abcd end+2305843009213693950 -} {} -test util-9.46 {TclGetIntForIndex} { - string index abcd end+4294967294 -} {} test util-10.1 {Tcl_PrintDouble - rounding} {ieeeFloatingPoint} { convertDouble 0x0000000000000000 diff --git a/unix/configure b/unix/configure index 329f9af..cffb454 100755 --- a/unix/configure +++ b/unix/configure @@ -4260,8 +4260,6 @@ $as_echo "#define TCL_CFGVAL_ENCODING \"iso8859-1\"" >>confdefs.h #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. - # Also, Linux requires the "ieee" library for math to work - # right (and it must appear before "-lm"). #-------------------------------------------------------------------- ac_fn_c_check_func "$LINENO" "sin" "ac_cv_func_sin" @@ -4271,40 +4269,6 @@ else MATH_LIBS="-lm" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lieee" >&5 -$as_echo_n "checking for main in -lieee... " >&6; } -if ${ac_cv_lib_ieee_main+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lieee $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ -return main (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_ieee_main=yes -else - ac_cv_lib_ieee_main=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ieee_main" >&5 -$as_echo "$ac_cv_lib_ieee_main" >&6; } -if test "x$ac_cv_lib_ieee_main" = xyes; then : - MATH_LIBS="-lieee $MATH_LIBS" -fi - #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 5305e7f..a6abef1 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -2370,12 +2370,9 @@ AC_DEFUN([SC_TCL_LINK_LIBS], [ #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. - # Also, Linux requires the "ieee" library for math to work - # right (and it must appear before "-lm"). #-------------------------------------------------------------------- AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") - AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it |
