Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f503b4a1993f3c5550e00e0193bb0a166887a3bd2f0f2fb25ecd4d3d0873c2e6
Ticket: 656fe3c8163aea1bbf10552962fcc79cb49c5bad
Tcl_DictObjPut() - poor usability
User & Date: dgp on 2019-07-25 16:29:57
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    Tcl_DictObjPut(..., dictPtr, keyPtr, valPtr);
    
    Sometimes the dict will store a ref to keyPtr and increment its refcount,
    effectively taking responsibility for later release, but not always. Notably,
    if an equal key is already in the dict, the old one is kept in preference to
    swapping the new one in.
    
    This places more burden on refcounting on the caller, and makes calls like
    
    Tcl_DictObjPut(..., dictPtr, Tcl_NewStringObj(...), valPtr)
    
    unsafe to use -- even though many such examples are in Tcl's own source code.
    
  5. is_private changed to: "0"
  6. login: "dgp"
  7. priority changed to: "5 Medium"
  8. resolution changed to: "None"
  9. severity changed to: "Minor"
  10. status changed to: "Open"
  11. submitter changed to: "dgp"
  12. subsystem changed to: "15. Dict Object"
  13. title changed to: "Tcl_DictObjPut() - poor usability"
  14. type changed to: "Bug"