Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 95cab08b0697402b1e1ee999e283aa35099614d1
Ticket: 217788ffffffffffffffffffffffffffffffffff
TclEvalObj does not work
User & Date: nobody on 2000-10-26 00:43:40
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 861 Bug
    Version: 8.1a2
    SubmitDate: '1998-11-25'
    LastModified: '1998-12-08'
    Severity: SER
    Status: Closed
    Submitter: pat
    ChangedBy: stanton
    RelatedBugIDs: 786
    OS: All
    OSVersion: NA
    Machine: NA
    FixedDate: '2000-10-25'
    FixedInVersion: NA
    ClosedDate: '1998-12-08'
    
    
    Date: Mon, 2 Nov 1998 11:59:45 -0800 (PST)
    To: [email protected]
    Cc: [email protected]
    Subject: TclEvalObj does not work
    From: [email protected]
    
    Tcl 8.1a2 Bug
    
    email:  [email protected]
    Support:  None
    Severity:  2
    OperatingSystem:  Other
    OperatingSystemVersion:  SCO Unix, AIX
    CustomShell:  None
    Synopsis:  TclEvalObj does not work
    
    ReproducibleScript:
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <tcl.h>
    
    #define STRING1 "puts \"hello there\"; set a \"hi\"; set b \"there\"; set c \"$a
     $b\" "
    
    void main(void)
    {
    Tcl_Obj *ftn1;
    Tcl_Interp *Interp;   // main command interp
    
        if ( (Interp=Tcl_CreateInterp()) == NULL)
          {
          fprintf(stderr,"Tcl_CreateInterp failed\n");
          }
    
        if ( (ftn1=Tcl_NewStringObj(STRING1,strlen(STRING1))) == NULL)
          fprintf(stderr,"Tcl_NewStringObj failed");
    
        if (Tcl_EvalObj(Interp,ftn1,0) != TCL_OK)
          {
          fprintf(stderr, "code block failed\n");
          }
        printf("Result [%s]\n",Tcl_GetStringFromObj(Tcl_GetObjResult(Interp),NULL));
        if (Tcl_EvalObj(Interp,ftn1,0) != TCL_OK)
          {
          fprintf(stderr, "code block failed\n");
          }
        printf("Result [%s]\n",Tcl_GetStringFromObj(Tcl_GetObjResult(Interp),NULL));
        if (Tcl_EvalObj(Interp,ftn1,0) != TCL_OK)
          {
          fprintf(stderr, "code block failed\n");
          }
        printf("Result[%s]\n", Tcl_GetStringFromObj(Tcl_GetObjResult(Interp),NULL));
    }
    
    ObservedBehavior:
    The TclEvalObj only executes the TclObject once,
    Subsequent TclEvalObj executions fail on that TclObject.
    If there are many TclEvalObj on multiple TclObject executing
    multiple times, the programs usually crashes.
    This code runs fine and is very stable in Tcl 8.0.3
    
    DesiredBehavior:
    The TclObject from what I understand is supposed to
    store a byte code representation of the ASCII commands
    after the first execution of the command.  Subsequent execution
    should be significantly faster when using the byte code.
    The work around is to use TclEval instead of TclEvalObj which
    slows down the performance significantly.
    
    
    
    
    
  4. foundin changed to: "obsolete: 8.1a2"
  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: "TclEvalObj does not work"
  11. type changed to: "Bug"