Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b563407f82970fd9712cdc44b3047314223153ef
Ticket: 3084489fffffffffffffffffffffffffffffffff
Serious issue: Tcl_DuplicateObj isn't making a copy?
User & Date: anonymous on 2010-10-10 00:43:20
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    http://mkextensions.sourceforge.net/mkGeneric13.htm package provides C commands called lminus and linter.  Under Tcl 8.4 the commands work as expected.  Under Tcl 8.5.7 (running in AOLserver 4.5 on Windows, have not tested on any other platform), providing a pure tcl list (no string rep) as an argument to lminus will result in having the original list's list structure resorted.  (In the scenario in which I discovered this, I actually see the string rep retain the original sequence even as list commands return data in different sequence from its string rep but I don't have a simple test case for that side-effect).
    
    As far as I can tell by looking at the source for this command, the first thing it does is Tcl_DuplicateObj (arvg[1]) (it uses a _DOB macro) and then performs its sort operation on the resulting object.
    
    Here is Tcl code you can use to replicate this problem:
    set listA [list c b a]
    set listB [list c b a z]
    lminus $listB $listA
    lindex $listA 0
    - will return a instead of c
    
    Again lists must be pure. If you do set listA "c b a", the problem does not occur.
    
    Feel free to email to [email protected] with any questions
    
  4. foundin changed to: "obsolete: 8.5.7"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. subsystem changed to: "10. Objects"
  10. title changed to:
    Serious issue: Tcl_DuplicateObj isn't making a copy?
    
  11. type changed to: "Bug"