Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 14e4821d1b8826be152a6287370d2c4625597487
Ticket: 218482ffffffffffffffffffffffffffffffffff
parser modifies strings in place and interferes with literal
User & Date: nobody on 2000-10-26 01:01:06
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 686 Bug
    Version: 8.1a2
    SubmitDate: '1998-10-02'
    LastModified: '1998-10-02'
    Severity: CRIT
    Status: Released
    Submitter: stanton
    ChangedBy: stanton
    OS: All
    OSVersion: NA
    Machine: NA
    FixedDate: '2000-10-25'
    FixedInVersion: 8.1b1
    ClosedDate: '1998-10-02'
    
    
    This bug is reproducible by running the new auto_mkindex mechanism in the Tcl library directory.
    
    
    
    The problem is that the parser modifies the string it is parsing and then restores the string when it is done.  The parser also adds strings to the literal table while parsing.  If it causes the literal table to expand while before it restores the string, the hash value will be incorrect and the string will be misplaced.  This is a specific instance of a more general problem with code that modifies strings in place.  In general strings may be cached in arbitrary ways.  If a routine modifies a string in place, it must be careful to only call functions that cannot affect any other parts of the system before it restores any strings that it has modified.
    
    In this particular case, the solution is to move the code that restores the string so that it appears before any calls that affect the literal table.
    
    
    
  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:
    parser modifies strings in place and interferes with literal
    
  11. type changed to: "Bug"