Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8d6b371217a6dc996030ef0f83c97288ddb049a8
Ticket: 218008ffffffffffffffffffffffffffffffffff
"bug" in TCL object routines (8.0.3)
User & Date: nobody on 2000-10-26 00:52:03
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 854 RFE
    Version: 8.0.3
    SubmitDate: '1998-11-25'
    LastModified: '1998-11-25'
    Severity: LOW
    Status: Closed
    Submitter: pat
    ChangedBy: pat
    OS: All
    OSVersion: NA
    Machine: NA
    FixedDate: '2000-10-25'
    FixedInVersion: NA
    ClosedDate: '1998-11-25'
    
    
    Date: Wed, 14 Oct 98 13:53:42 EDT
    From: "[email protected] (SHR3-2/S30, 237-3151)" <[email protected]>
    To: [email protected]
    Cc: [email protected]
    Apparently-to: [email protected]
    Subject: "bug" in TCL object routines (8.0.3)
    
    #include <stdio.h>
    #include <stdlib.h>
    #include <tcl.h>
    
    /*
    ** This small program demonstrates what I believe to be a bug in the
    ** Tcl object routines.  I'm assuming that it was intended that the
    ** object routines can be used "external" to Tcl (i.e., without
    ** having to initialize an interpreter).  This is useful because
    ** it allows non-Tcl programs to generate Tcl-format lists that
    ** may be used as input to Tcl programs.  When compiled and run as
    ** written, this program should work fine.  If the call to
    ** Tcl_GetObjType() is removed, the program should seg. fault
    ** (access violation).
    **
    ** I'd appreciate it if you would consider making a change to the
    ** core sources to correct this at some point.
    **
    ** thanks,
    **
    ** Roy Lane, Compaq ([email protected])
    **
    ** (p.s., I'm using the 8.0.3 version of the Tcl sources)
    */
    
    main()
    
    {
        Tcl_Obj* list;
    
        /*
        ** A call to Tcl_GetObjType() is required to set up the "type
        ** table" used by objects in order to use the list routines
        ** independent of a Tcl interpreter.  This really is a kludge
        ** work-around I figured out after looking at the code.  The
        ** object routines should be modified so that they make sure
        ** the "type table" is properly initialized.
        */
    
        Tcl_GetObjType("");
    
        list = Tcl_NewListObj(0, 0);
    
        Tcl_ListObjAppendElement(0, list, Tcl_NewStringObj("test$name", -1));
    
        Tcl_ListObjAppendElement(0, list, Tcl_NewStringObj("mbox_name", -1));
    
        Tcl_ListObjAppendElement(0, list, Tcl_NewStringObj("5 2", -1));
    
        Tcl_ListObjAppendElement(0, list, Tcl_NewStringObj("", -1));
    
        printf("'%s'\n", Tcl_GetStringFromObj(list, 0));
    
        Tcl_DecrRefCount(list);
    
        return (EXIT_SUCCESS);
    }
    
    
    
    Brent said that there is a valid workaround and a fix would add too much overhead to all 
    list creation routines (11/25/98 pat)
    
    
    
  4. foundin changed to: "obsolete: 8.0.3"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "10. Objects"
  10. title changed to: ""bug" in TCL object routines (8.0.3)"
  11. type changed to: "Bug"