Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: bb8bf741911152cccacf169e12c1aba16067b889
Ticket: 752814ffffffffffffffffffffffffffffffffff
Inhibit some type conversions
User & Date: ysutjandra on 2003-06-11 18:54:42
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Hi,
    
    I found that regexp changes the object type to string 
    type.  I see this behavior in Tcl8.3.5 but not in Tcl8.1.
    
    The stack trace when it calls the registered function to 
    free the old internal representation looks as follows:
    
    #1  0x9d2a4 in SetStringFromAny (interp=0x0, 
    objPtr=0x11ebf8) at ./../generic/tclStringObj.c:1505
    #2  0x9bc3c in Tcl_GetCharLength (objPtr=0x11ebf8) 
    at ./../generic/tclStringObj.c:329
    #3  0x2fab4 in Tcl_RegexpObjCmd (dummy=0x0, 
    interp=0xfdd68, objc=2, objv=0xffdac) 
    at ./../generic/tclCmdMZ.c:227
    
    The question is why Tcl_GetCharLength requires 
    changing the internal representation to string object.  It 
    should simply call Tcl_GetStringFromObj and does a 
    strlen on the return C-string.
    
    Looking at the code tclCmdMZ.c, it has the following 
    comment...
    
      Get the length of the string that we are matching
      before getting the regexp to avoid shimmering problems.
    
    -- Yohan
    
  4. foundin changed to: "final: 8.3.5"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "ysutjandra"
  9. subsystem changed to: "43. Regexp"
  10. title changed to: "Regexp change Tcl_Obj type to string"
  11. type changed to: "RFE"