Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d16639d8a72b39f592caad8a7438ff814e663484
Ticket: 3562482fffffffffffffffffffffffffffffffff
info frame gives wrong line number in catch
User & Date: duquette on 2012-08-28 16:10:06
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    This occurs in Tcl 8.5.10 on Windows 7, Tcl 8.5.10.  The following script (also attached)
    
    ====================================================
    set script {
        puts "line 2: [info frame 0]"
        set a 5               ;# End line comment
                              ;# End line comment with unneeded semi-colon
        puts "line 5: [info frame 0]"
    }
    
    catch $script
    =====================================================
    
    gives the following output:
    
    =====================================================
    $ tclsh bug2.tcl
    line 2: type eval line 2 cmd {info frame 0} level 0
    line 5: type eval line 4 cmd {info frame 0} level 0
    =====================================================
    
    The line number reported by the second [info frame] call is off by one line number.
    
    The culprit appears to be the line just previous, which begins with "    ;#".  The semi-colon is unnecessary, and if it is removed, the line number is reported correctly.
    
    Subsequent occurrences of the same pattern will cause the offset to increment.
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "duquette"
  10. subsystem changed to: "None"
  11. title changed to: "info frame gives wrong line number in catch"
  12. type changed to: "Bug"