64bit integer support for lsort
Closed / Fixed218988ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:08:59
OriginalBugID: 3652 Bug
Version: 8.2.2
SubmitDate: '1999-11-23'
LastModified: '1999-11-24'
Severity: LOW
Status: Released
Submitter: techsupp
ChangedBy: hobbs
OS: All Unix
OSVersion: Tru64Unix 4.0F
Machine: AlphaServer
FixedDate: '1999-11-24'
FixedInVersion: 8.3b1
ClosedDate: '2000-10-25'
Name: kazuro furukawa
Comments:
Since this patch does not do
any harm on 32bit machines,
I hope this patch is applied in
the core.
ReproducibleScript:
% lsort -integer "1234567890 12345678901"
ObservedBehavior:
"integer value too large to represent as non-long integer"
DesiredBehavior:
64bit integers should be handled on
64bit machines.
Patch:
% diff -u tclCmdIL.c.org tclCmdIL.c | more
--- tclCmdIL.c.org Wed Sep 22 13:12:46 1999
+++ tclCmdIL.c Mon Nov 15 14:46:35 1999
@@ -2786,10 +2786,14 @@
order = DictionaryCompare(
Tcl_GetString(objPtr1), Tcl_GetString(objPtr2));
} else if (infoPtr->sortMode == SORTMODE_INTEGER) {
- int a, b;
+ /*
+ * for 64bit machines, integer comparison must be carried
+ * with long integer. k.furukawa.
+ */
+ long a, b;
- if ((Tcl_GetIntFromObj(infoPtr->interp, objPtr1, &a) != TCL_OK)
- || (Tcl_GetIntFromObj(infoPtr->interp, objPtr2, &b)
+ if ((Tcl_GetLongFromObj(infoPtr->interp, objPtr1, &a) != TCL_OK)
+ || (Tcl_GetLongFromObj(infoPtr->interp, objPtr2, &b)
!= TCL_OK)) {
infoPtr->resultCode = TCL_ERROR;
return order;
PatchFiles:
tclCmdIL.c
Added to 8.3b1 core.
-- 11/24/1999 hobbs
welch Closed ticket [218988ffff].
[History diff]2000-10-26 08:33:07
Log in (anonymous is fine) to add a comment.