summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclExecute.c8
-rw-r--r--generic/tclObj.c2
-rw-r--r--generic/tclStubInit.c4
-rw-r--r--tests/get.test18
-rw-r--r--tests/string.test6
5 files changed, 17 insertions, 21 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 027b8f3..2b197c6 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -5732,14 +5732,6 @@ TEBCresume(
case INST_NUM_TYPE:
if (GetNumberFromObj(NULL, OBJ_AT_TOS, &ptr1, &type1) != TCL_OK) {
type1 = 0;
- } else if (type1 == TCL_NUMBER_BIG) {
- /* value is an integer outside the WIDE_MIN to WIDE_MAX range */
- /* [string is wideinteger] is WIDE_MIN to WIDE_MAX range */
- Tcl_WideInt w;
-
- if (TclGetWideIntFromObj(NULL, OBJ_AT_TOS, &w) == TCL_OK) {
- type1 = TCL_NUMBER_INT;
- }
}
TclNewIntObj(objResultPtr, type1);
TRACE(("\"%.20s\" => %d\n", O2S(OBJ_AT_TOS), type1));
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 1a9925b..3b650e2 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -2768,7 +2768,7 @@ Tcl_GetIntFromObj(
if ((ULONG_MAX > UINT_MAX) && ((l > UINT_MAX) || (l < INT_MIN))) {
if (interp != NULL) {
const char *s =
- "integer value too large to represent as non-long integer";
+ "integer value too large to represent";
Tcl_SetObjResult(interp, Tcl_NewStringObj(s, -1));
Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, NULL);
}
diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c
index fd06c14..d34aff4 100644
--- a/generic/tclStubInit.c
+++ b/generic/tclStubInit.c
@@ -563,7 +563,7 @@ static int exprInt(Tcl_Interp *interp, const char *expr, int *ptr){
*ptr = (int)longValue;
} else {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "integer value too large to represent as non-long integer", -1));
+ "integer value too large to represent", -1));
result = TCL_ERROR;
}
}
@@ -579,7 +579,7 @@ static int exprIntObj(Tcl_Interp *interp, Tcl_Obj*expr, int *ptr){
*ptr = (int)longValue;
} else {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "integer value too large to represent as non-long integer", -1));
+ "integer value too large to represent", -1));
result = TCL_ERROR;
}
}
diff --git a/tests/get.test b/tests/get.test
index 25f8d77..8232a9a 100644
--- a/tests/get.test
+++ b/tests/get.test
@@ -20,8 +20,6 @@ catch [list package require -exact tcl::test [info patchlevel]]
testConstraint testgetint [llength [info commands testgetint]]
testConstraint testdoubleobj [llength [info commands testdoubleobj]]
-testConstraint longIs32bit [expr {$tcl_platform(wordSize) == 4}]
-testConstraint longIs64bit [expr {$tcl_platform(wordSize) == 8}]
test get-1.1 {Tcl_GetInt procedure} testgetint {
testgetint 44 { 22}
@@ -41,28 +39,28 @@ test get-1.5 {Tcl_GetInt procedure} testgetint {
test get-1.6 {Tcl_GetInt procedure} testgetint {
list [catch {testgetint 44 {16 x}} msg] $msg
} {1 {expected integer but got "16 x"}}
-test get-1.7 {Tcl_GetInt procedure} {testgetint longIs64bit} {
+test get-1.7 {Tcl_GetInt procedure} testgetint {
list [catch {testgetint 44 18446744073709551616} msg] $msg $errorCode
} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}
-test get-1.8 {Tcl_GetInt procedure} {testgetint longIs64bit} {
+test get-1.8 {Tcl_GetInt procedure} testgetint {
testgetint 18446744073709551614
} {-2}
-test get-1.9 {Tcl_GetInt procedure} {testgetint longIs64bit} {
+test get-1.9 {Tcl_GetInt procedure} testgetint {
testgetint +18446744073709551614
} {-2}
-test get-1.10 {Tcl_GetInt procedure} {testgetint longIs64bit} {
+test get-1.10 {Tcl_GetInt procedure} testgetint {
list [catch {testgetint -18446744073709551614} msg] $msg $errorCode
} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}
-test get-1.11 {Tcl_GetInt procedure} {testgetint longIs32bit} {
+test get-1.11 {Tcl_GetInt procedure} testgetint {
list [catch {testgetint 44 4294967296} msg] $msg $errorCode
} {1 {integer value too large to represent} {ARITH IOVERFLOW {integer value too large to represent}}}
-test get-1.12 {Tcl_GetInt procedure} {testgetint longIs32bit} {
+test get-1.12 {Tcl_GetInt procedure} testgetint {
list [catch {testgetint 4294967294} msg] $msg
} {0 -2}
-test get-1.13 {Tcl_GetInt procedure} {testgetint longIs32bit} {
+test get-1.13 {Tcl_GetInt procedure} testgetint {
list [catch {testgetint +4294967294} msg] $msg
} {0 -2}
-test get-1.14 {Tcl_GetInt procedure} {testgetint longIs32bit} {
+test get-1.14 {Tcl_GetInt procedure} testgetint {
list [catch {testgetint -4294967294} msg] $msg
} {1 {integer value too large to represent}}
diff --git a/tests/string.test b/tests/string.test
index 1a48d97..d497b42 100644
--- a/tests/string.test
+++ b/tests/string.test
@@ -985,6 +985,12 @@ test string-6.137.$noComp {string is unicode, noncharacter} {
test string-6.138.$noComp {string is unicode, noncharacter} {
run {string is unicode \uFDEF}
} 0
+test string-6.139.$noComp {string is integer, bug [76ad7aeba3]} {
+ run {string is integer 18446744073709551615}
+} 1
+test string-6.140.$noComp {string is integer, bug [76ad7aeba3]} {
+ run {string is integer -18446744073709551615}
+} 1
test string-7.1.$noComp {string last, not enough args} {