Tcl Source Code

View Ticket
Login
Ticket UUID: 2850901
Title: bad line count from [info frame]
Type: Bug Created on: 2009-09-04 04:48:09
Submitter: dgp Assigned to: dgp
Subsystem: 47. Bytecode Compiler Severity:
Priority: 5 Medium Last modified: 2009-09-08 03:02:50
Status: Closed Closed by: dgp
Resolution: Fixed Closed on: 2009-09-07 20:02:50
Version: obsolete: 8.6b1.1
Description:
I think this is due to a flaw in TclCompileScript:

$ cat lines.tcl
puts [format %s {}
][info frame 0]

$ make shell SCRIPT=lines.tcl
...
type source line 1 file /home/dgp/cvs/tcl-only/unix/lines.tcl cmd {info frame 0} level 0

Ought to report line 2 instead of line 1.
User Comments:
dgp added on 2009-09-04 20:12:40:
Actually that original demo shows the
same problem in TclSubstTokens.

To see it in TclCompileScript, do this:

$ make shell
...
% source lines.tcl

I have a fix for TclCompileScript in my sandbox.

dgp added on 2009-09-05 00:34:38:
Patch 2314561 included the fix for the
TclCompileScript flaw.  Ticket still open
for the other path to be fixed up.

andreas_kupries added on 2009-09-05 02:57:07:
Thanks for the #280 work.

andreas_kupries added on 2009-09-05 03:29:00:
Uh. Crash.

    info.test
    ---- info-30.30 start
   ++++ info-30.30 PASSED
    ---- info-30.31 start
    Test file error:
    Bad stack top 5 at pc 59 in TclExecuteByteCode (min 0, max 4)
      executing info frame 0
    TclExecuteByteCode execution failure: bad stack top

dgp added on 2009-09-08 03:02:50:

allow_comments - 1


fix committed to HEAD