diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-04-15 10:46:23 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2014-04-15 10:46:23 (GMT) |
commit | 13aaf9c46acb147461bc3f09089c575d4af087d0 (patch) | |
tree | 2e730303ac5a9123665101be96e596e006d88753 /generic/tclExecute.c | |
parent | b548441f399cf039b31e3f120b693ec61e574e7f (diff) | |
parent | 363b6911107557283c7fec07e041e14c7af7eee3 (diff) | |
download | tcl-13aaf9c46acb147461bc3f09089c575d4af087d0.zip tcl-13aaf9c46acb147461bc3f09089c575d4af087d0.tar.gz tcl-13aaf9c46acb147461bc3f09089c575d4af087d0.tar.bz2 |
merge trunk
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index cd0371b..25f4951 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -5857,6 +5857,31 @@ TEBCresume( case INST_NUM_TYPE: if (GetNumberFromObj(NULL, OBJ_AT_TOS, &ptr1, &type1) != TCL_OK) { type1 = 0; + } else if (type1 == TCL_NUMBER_LONG) { + /* value is between LONG_MIN and LONG_MAX */ + /* [string is integer] is -UINT_MAX to UINT_MAX range */ + int i; + + if (Tcl_GetIntFromObj(NULL, OBJ_AT_TOS, &i) != TCL_OK) { + type1 = TCL_NUMBER_WIDE; + } +#ifndef TCL_WIDE_INT_IS_LONG + } else if (type1 == TCL_NUMBER_WIDE) { + /* value is between WIDE_MIN and WIDE_MAX */ + /* [string is wideinteger] is -UWIDE_MAX to UWIDE_MAX range */ + int i; + if (Tcl_GetIntFromObj(NULL, OBJ_AT_TOS, &i) == TCL_OK) { + type1 = TCL_NUMBER_LONG; + } +#endif + } else if (type1 == TCL_NUMBER_BIG) { + /* value is an integer outside the WIDE_MIN to WIDE_MAX range */ + /* [string is wideinteger] is -UWIDE_MAX to UWIDE_MAX range */ + Tcl_WideInt w; + + if (Tcl_GetWideIntFromObj(NULL, OBJ_AT_TOS, &w) == TCL_OK) { + type1 = TCL_NUMBER_WIDE; + } } TclNewLongObj(objResultPtr, type1); TRACE(("\"%.20s\" => %d\n", O2S(OBJ_AT_TOS), type1)); |