diff options
author | dgp <dgp@users.sourceforge.net> | 2020-09-02 20:22:15 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2020-09-02 20:22:15 (GMT) |
commit | 712f88bef73db43ea3e8169d8c5609ec420b3bf2 (patch) | |
tree | fa06dc169be56e3e15b3333290345f8532cb0065 /generic/tclUtil.c | |
parent | ee7073e46860e7e4746d0f8d68a8b66e708eb763 (diff) | |
download | tcl-712f88bef73db43ea3e8169d8c5609ec420b3bf2.zip tcl-712f88bef73db43ea3e8169d8c5609ec420b3bf2.tar.gz tcl-712f88bef73db43ea3e8169d8c5609ec420b3bf2.tar.bz2 |
Fix for test lindex-18.0
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r-- | generic/tclUtil.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 5b296f0..8db6606 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -3817,7 +3817,7 @@ GetEndOffsetFromObj( if ((t1 == TCL_NUMBER_INT) && (t2 == TCL_NUMBER_INT)) { /* Both are wide, do wide-integer math */ if (*opPtr == '-') { - if ((w2 == WIDE_MIN) && (interp != NULL)) { + if (w2 == WIDE_MIN) { goto extreme; } w2 = -w2; @@ -3839,13 +3839,6 @@ GetEndOffsetFromObj( offset = WIDE_MIN; } } - } else if (interp == NULL) { - /* - * We use an interp to do bignum index calculations. - * If we don't get one, call all indices with bignums errors, - * and rely on callers to handle it. - */ - goto parseError; } else { /* * At least one is big, do bignum math. Little reason to @@ -3856,7 +3849,13 @@ GetEndOffsetFromObj( Tcl_Obj *sum; extreme: - Tcl_ExprObj(interp, objPtr, &sum); + if (interp) { + Tcl_ExprObj(interp, objPtr, &sum); + } else { + Tcl_Interp *compute = Tcl_CreateInterp(); + Tcl_ExprObj(compute, objPtr, &sum); + Tcl_DeleteInterp(compute); + } TclGetNumberFromObj(NULL, sum, &cd, &numType); if (numType == TCL_NUMBER_INT) { |