Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0bcbb432e7c88e12edd41d45b78fc1c09ca7882b
Ticket: 813056ffffffffffffffffffffffffffffffffff
Tcl_GetIndexFromObjStruct doesn't reset result before error
User & Date: muonics on 2003-09-26 13:26:28
Changes

  1. assignee changed to: "nijtmans"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Tcl_GetIndexFromObjStruct doesn't reset prior result
    information in the interpreter when generating its
    so-called (in the comments) "fancy error message". 
    This means that if you've done something that has set a
    result before calling it or Tcl_GetIndexFromObj
    (including calling Tcl_GetIndexFromObj multiple times
    with multiple errors) you get bogus error messages.
    
    In the particular case I noticed this, I have an ObjCmd
    that separates out certain option arguments that it
    wants and delegates the remaining options to another
    ObjCmd.  Here I use the TCL_ERROR vs. TCL_OK result to
    determine whether an option was matched within the set
    that the first function wants.  It's a little more
    maintainable this way (though perhaps slower with all
    those error messages being generated) to have the first
    function only know about the small subset of options
    that it wants.  At any rate, I noticed that when
    feeding the command a bunch of options where one wasn't
    recognized by either generated an error message with
    repeated error messages and other result bits.
    
    See below for suggested patch.
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "muonics"
  9. subsystem changed to: "13. Index Object"
  10. title changed to:
    Tcl_GetIndexFromObjStruct doesn't reset result before error
    
  11. type changed to: "Bug"