Skip to content
Tcl Source Code History Of Ticket 3019348
Login

History Of Ticket 3019348

Artifacts Associated With Ticket 3019348

  1. Ticket change [e487a64ff7] (rid 87967) by andygoth on 2010-06-22 01:32:21:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      My expectation is that when lset throws an error, it won't modify the list.  However, the following script shows otherwise:
      
      % set foo {}
      % lset foo 0 0 x
      x
      % lset foo 0 1 x
      {x x}
      % lset foo 1 0 x
      {x x} x
      % lset foo 1 1 x
      {x x} {x x}
      % lset foo 2 1 x
      list index out of range
      % set foo
      {x x} {x x} {}
      % lset foo 3 0 x
      {x x} {x x} {} x
      % lset foo 3 1 x
      {x x} {x x} {} {x x}
      
      The command [lset foo 2 1 x] throws an error but also adds an empty element to the end of the list.
      
    4. foundin initialized to: "obsolete: 8.6b1.1"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "andygoth"
    10. subsystem initialized to: "17. Commands I-L"
    11. title initialized to: "Nested lset can modify list on error"
    12. type initialized to: "Bug"
  2. Ticket change [2a4855b4aa] (rid 118525) by dkf on 2010-06-22 14:58:08:

    1. assignee changed to: "kennykb"
    2. subsystem changed to: "14. List Object"
  3. Ticket change [f6cc679c34] (rid 130362) by dkf on 2012-05-30 17:49:24:

    1. resolution changed to: "Remind"
  4. Ticket change [a9f0f9f4fd] (rid 258510) by serhiy.storchaka on 2026-10-17 09:15:46:

    1. foundin changed to: "8.6.18, 9.0.5, 9.1.0"
    2. icomment:
      Still present in 8.6, 9.0 and 9.1: since TIP 331 ([41ad4c4b67]) TclLsetFlat() appends an empty sublist for an index equal to the list length before checking the remaining indices, and does not remove it when one of them fails. Inside a procedure the literal list is shared and copied, which hides the problem.
      Proposed fix in branch [/timeline?r=lset-undo-append-on-error|lset-undo-append-on-error]: remove the appended sublist on error. Tests lset-17.1 to lset-17.3.
      
    3. login: "serhiy.storchaka"
    4. mimetype: "text/x-fossil-wiki"
  5. Ticket change [c9f0351c63] (rid 258629) by apnadkarni on 2026-10-17 16:54:54:

    1. assignee changed to: "apnadkarni"
    2. closer changed to: "nobody"
    3. comment changed to:
      My expectation is that when lset throws an error, it won't modify the list.  However, the following script shows otherwise:
      
      % set foo {}
      % lset foo 0 0 x
      x
      % lset foo 0 1 x
      {x x}
      % lset foo 1 0 x
      {x x} x
      % lset foo 1 1 x
      {x x} {x x}
      % lset foo 2 1 x
      list index out of range
      % set foo
      {x x} {x x} {}
      % lset foo 3 0 x
      {x x} {x x} {} x
      % lset foo 3 1 x
      {x x} {x x} {} {x x}
      
      The command [lset foo 2 1 x] throws an error but also adds an empty element to the end of the list.
      
    4. login: "apnadkarni"
    5. mimetype: "text/plain"
    6. severity changed to: "Minor"
  6. Ticket change [74fcf066be] (rid 259210) by apnadkarni on 2026-10-19 04:52:11:

    1. icomment:
      @serhiy.storchaka Looks fine but I've made some modifications in branch [apn-lset-undo-append-on-error](https://core.tcl-lang.org/tcl/timeline?r=apn-lset-undo-append-on-error) to eliminate some redundant/unnecessary checks. If you are ok with those changes, you can commit that branch to trunk and 9.0. Or I can, if you prefer.
      
    2. login: "apnadkarni"
    3. mimetype: "text/x-markdown"
  7. Ticket change [468e9b0813] (rid 259213) by serhiy.storchaka on 2026-10-19 06:29:22:

    1. icomment:
      Your changes look fine to me. The branch conflicted with trunk, where the fix for [526b01c0b9] holds a reference to the sublist around <tt>TclListObjSetElement()</tt>; I merged trunk into [/timeline?r=apn-lset-undo-append-on-error|apn-lset-undo-append-on-error] and kept that hold in your replace branch (lset-19.1 crashes without it). Please merge it to trunk and 9.0.
      
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"
  8. Ticket change [c82e201be9] (rid 259219) by apnadkarni on 2026-10-19 09:58:26:

    1. icomment: "Fixed for 9.1 in [6a23978bf0]. Pending 9.0 merge."
    2. login: "apnadkarni"
    3. mimetype: "text/x-fossil-plain"
    4. resolution changed to: "Fixed"
  9. Ticket change [11a8dab1c2] (rid 259223) by apnadkarni on 2026-10-19 10:13:36:

    1. closedate changed to: "2461332.9261201969"
    2. closer changed to: "apnadkarni"
    3. icomment: "Fixed for 9.0 in [27d3ea715e]. Closing. Thanks!"
    4. login: "apnadkarni"
    5. mimetype: "text/x-markdown"
    6. status changed to: "Closed"