Skip to content
Tcl Source Code History Of Ticket 1468052732
Login

History Of Ticket 1468052732

Artifacts Associated With Ticket 1468052732

  1. Ticket change [3e4d5f2962] (rid 218684) by anonymous on 2023-09-25 17:34:13:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-plain"
    4. comment initialized to:
      Checkin b680b1f0b3 changes stub entry 33 from
      
      unsigned char *TclGetByteArrayFromObj(Tcl_Obj *objPtr, void *numBytesPtr)
      
      to
      
      unsigned char *Tcl_GetByteArrayFromObj(Tcl_Obj *objPtr, int *numBytesPtr)
      
      It also removes the previous declaration of Tcl_GetByteArrayFromObj: 
      declare 653 {
          unsigned char *Tcl_GetByteArrayFromObj(Tcl_Obj *objPtr, Tcl_Size *numBytesPtr)
      }
      
      Shouldn't parameter numBytesPtr in entry 33 be a Tcl_Size* instead of int* ?
      
      Regards,
      Paul
      
    5. foundin initialized to: "9.0"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "2e499ca9e0149983f6f63603feedc5b33bc05f5e"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "anonymous"
    14. subsystem initialized to: "- New Stub Entries"
    15. title initialized to: "Changes to Tcl_GetByteArrayFromObj not correct?"
    16. type initialized to: "Bug"
  2. Ticket change [dd9ff02d7d] (rid 218688) by apnadkarni on 2023-09-25 18:06:30:

    1. icomment:
      Along the same lines (but not part of same commit), in Tcl 9 the current definition of Stub 41 is 
      
      ```
      declare 41 {
          char *TclGetStringFromObj(Tcl_Obj *objPtr, void *lengthPtr)
      }
      ```
      
      However, TclGetStringFromObj **always** treats lengthPtr as an `int *`. Thus following a "conflict-free" merge from core-8-branch, the following fragment caused a crash.
      
      ```
      Tcl_Size len;
      const char *path = TclGetStringFromObj(normPathPtr, &len);
      ...
      path[len-1] = '\0';
      ```
      
      because only the low four bytes of `len` were updated by the TGSFO call.
      
      Either Stub 41 should be removed, or defined as taking an `int*` so that compiler will catch these errors. The way it is currently defined serves no utility afaict but I'm wary of changing it myself in case there is some use I don't see.
      
      Alternately, define it as taking an `Tcl_Size *` and name it as `Tcl_GetStringFromObj` replacing stub 651.
      
    2. login: "apnadkarni"
    3. mimetype: "text/plain"
  3. Ticket change [846e4bd764] (rid 218703) by jan.nijtmans on 2023-09-25 18:42:12:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2460213.279315"
    3. closer changed to: "jan.nijtmans"
    4. icomment:
      > Either Stub 41 should be removed, or defined as taking an `int*` so that compiler will catch these errors. The way it is currently defined serves no utility afaict but I'm wary of changing it myself in case there is some use I don't see.
      
      The use for this function is [https://core.tcl-lang.org/tcl/file?name=generic/tclDecls.h&ci=35a5f655f5b9e16e&ln=4090-4093|here]. It isn't meant to be called directly by extensions.
      
      I would prefer your example code snippet to produce a compiler error, I'll think about it how to do that.
      
      Anyway, I don't like it when you hijack an unrelated ticket .....
      
      Closing (since changing "int *" to "Tcl_Size *" was a good idea, reduces confusion
      
    5. login: "jan.nijtmans"
    6. mimetype: "text/x-fossil-wiki"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"