summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2014-04-10 07:57:18 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2014-04-10 07:57:18 (GMT)
commit87fc10a8dab38ad4500fbf4e5a95f993f284ccf3 (patch)
tree4024d6f9c7a4cfea5f3e7bb8d7b9617cd5b05c19 /generic/tclExecute.c
parenta7350e3489296b2e835cccd6be98692f6c703f2e (diff)
downloadtcl-87fc10a8dab38ad4500fbf4e5a95f993f284ccf3.zip
tcl-87fc10a8dab38ad4500fbf4e5a95f993f284ccf3.tar.gz
tcl-87fc10a8dab38ad4500fbf4e5a95f993f284ccf3.tar.bz2
Fix bug [e663138a06]: Test failures in "string is"
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 41730d3..6394a60 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -5990,6 +5990,15 @@ TEBCresume(
if (GetNumberFromObj(NULL, OBJ_AT_TOS, &ptr1, &type1) != TCL_OK) {
type1 = 0;
}
+#ifndef TCL_WIDE_INT_IS_LONG
+ else if (type1 == TCL_NUMBER_WIDE) {
+ /** See bug [e663138a06] */
+ Tcl_WideInt value = (OBJ_AT_TOS)->internalRep.wideValue;
+ if ((-value <= ULONG_MAX) && (value <= ULONG_MAX)) {
+ type1 = TCL_NUMBER_LONG;
+ }
+ }
+#endif
TclNewIntObj(objResultPtr, type1);
TRACE(("\"%.20s\" => %d\n", O2S(OBJ_AT_TOS), type1));
NEXT_INST_F(1, 1, 1);