Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e1b5ef7019c48c24ade31f63b27c99bb6a23b4b8db3d5df76c9e85a84eec63a8
Ticket: 3216010fffffffffffffffffffffffffffffffff
lsort -integer fails with wide integers
User & Date: jan.nijtmans on 2022-11-22 22:43:38
Changes

  1. assignee changed to: "jan.nijtmans"
  2. closedate changed to: "2459906.4469747"
  3. closer changed to: "jan.nijtmans"
  4. comment changed to:
    lsort -integer fails when trying to sort a list of wide integers (i.e. a list with timestamps, like clock milliseconds returns).
    
    I see for example in Tcl_LsortObjCmd(), in file tclCmdIL.c, line 3911 (may have changed I haven't updated to fossil):
    
    } else if (sortMode == SORTMODE_INTEGER) {
      long a;
      if (TclGetLongFromObj(sortInfo.interp, indexPtr, &a) != TCL_OK) {
        sortInfo.resultCode = TCL_ERROR;
        goto done1;
      }
      elementArray[i].index.intValue = a;
    
    I think that Tcl_GetWideIntFromObj() should be called if Tcl_GetLongFromObj() fails, before returning an error to the caller...
    
  5. icomment: "Fixed [f70fa16889ed757d|here]"
  6. login: "jan.nijtmans"
  7. mimetype: "text/x-fossil-wiki"
  8. resolution changed to: "Fixed"
  9. severity changed to: "Minor"
  10. status changed to: "Closed"