Skip to content
Tcl Source Code History Of Ticket 3363556fff
Login

History Of Ticket 3363556fff

Artifacts Associated With Ticket 3363556fff

  1. Ticket change [709234c3bf] (rid 100509) by foomench on 2011-07-11 23:09:47:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Documentation for Tcl_SetObjResult states, "If objPtr is NULL, interp->objResult is set to a new Tcl object containing an empty string." However, the code doesn't do this. In fact, it tries to use objPtr in a Tcl_IncrRefCount call without checking for NULL, which results in an exception. Here's the code:
      
      void
      Tcl_SetObjResult(
          Tcl_Interp *interp,/* Interpreter with which to associate the
       * return object value. */
          register Tcl_Obj *objPtr)/* Tcl object to be returned. If NULL, the obj
       * result is made an empty string object. */
      {
          register Interp *iPtr = (Interp *) interp;
          register Tcl_Obj *oldObjResult = iPtr->objResultPtr;
      
          iPtr->objResultPtr = objPtr;
          Tcl_IncrRefCount(objPtr);/* since interp result is a reference */
      ...
      
    4. foundin initialized to: "None"
    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: "foomench"
    10. subsystem initialized to: "10. Objects"
    11. title initialized to:
      Tcl_SetObjResult can't handle NULL, despite documentation
      
    12. type initialized to: "Bug"
  2. Ticket change [98aecc9ff5] (rid 110651) by msofer on 2011-07-12 19:52:02:

    1. icomment:
      I could only find an inline comment (in the function argument list) stating that NULL is converted to empty, but it does not correspond exactly to your quote. That comment is indeed NOT in agreement with the code, one of the two should (and will) be fixed.
      
      I couldn't find any docs mentioning Tcl_SetObjResult's ability to handle a NULL objPtr. The manual page for Tcl_SetObjResult describes pretty much what the code is doing: "Tcl_SetObjResult arranges for objPtr to be the result for interp, replacing any existing result. The result is left pointing to the object referenced by objPtr. objPtr's reference count is incremented since there is now a new reference to it from interp. The reference count for any old result object is decremented and the old result object is freed if no references to it remain." This part of the man page SetResult.3 seems to have been unchanged since 1998-03-26
      
      Which documentation are you quoting from? 
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  3. Ticket change [cd9f6c9e9e] (rid 95926) by foomench on 2011-07-12 20:21:58:

    1. icomment:
      I saw the inline comment in current (8.5.10) code. My quote is from
      http://www.astro.princeton.edu/~rhl/Tcl-Tk_docs/tcl/SetObjResult.3.html
      which is apparently not current.
      
      Sorry about the duplicate--browser back button did that.
      
      
    2. login: "foomench"
    3. mimetype: "text/plain"
    4. username: "foomench"
  4. Ticket change [79f3456127] (rid 90219) by msofer on 2011-07-12 21:07:41:

    1. icomment:
      Those docs are for tcl8.0a1 (first alpha version of Tcl8), very very much out of date and not even corresponding to any tcl version that was actually released.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"