Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2010-03-18
18:02 • Closed ticket [2971921fff]: Bytecode compiled try misses finally handler plu... artifact: ef1b361fcd user: dkf
18:01 • Ticket [2971921fff]: 4 changes artifact: be8f607b54 user: dkf
00:03 • Ticket [2971921fff]: 1 change artifact: 243965a3f1 user: dgp
2010-03-17
19:48 • Add attachment foo to ticket [2971921fff] artifact: 20b245a5f6 user: cyan
19:48 • Ticket [2971921fff] Bytecode compiled try misses finally handler status stil... artifact: 21c01b3743 user: cyan
12:30 • New ticket [2971921fff]. artifact: 263cb4184d user: cyan

Bytecode compiled try misses finally handler

Closed / Fixed2971921fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 17 years ago
Descriptionplain2010-03-17 12:30:14
Tcl from CVS on 2010-03-14 on Linux (Ubuntu 9.10 x86_64)

When a bytecode compiled try command throws an error in the body, which is caught in a trap {...} handler, the finally handler is not executed.

The following script reliably reproduces the problem for me:

proc go {} {
    try {
        puts "In try body"
        throw {bar} "hello"
    } trap {bar} {res options} {
        puts "trapped bar"
    } finally {
        puts "in finally"
    }
    puts "after try"
}

go

puts "-----------------"
try {
    puts "In try body"
    throw {bar} "hello"
} trap {bar} {res options} {
    puts "trapped bar"
} finally {
    puts "in finally"
}
puts "after try"


Expected output: 

In try body
trapped bar
in finally
after try
-----------------
In try body
trapped bar
in finally
after try


Problem output:
In try body
trapped bar
after try
-----------------
In try body
trapped bar
in finally
after try


The behaviour changed with the CVS commit "Compilation of [try] now enabled!" by dkf on 2010-02-09 22:51:53.
cyanplain2010-03-17 19:48:50
File Added - 367096: foo
dgp Ticket [2971921fff]: 1 change [History diff]2010-03-18 00:03:24
dkfplain2010-03-18 18:01:55
Oh dear, that wasn't very nice was it? I had a jump going to the wrong place (the middle of an instruction). I'm not quite sure what it did then as it was executing immediate data, but that was clearly wrong!

Fixed now.
dkfplain2010-03-18 18:02:06
allow_comments - 1
Log in (anonymous is fine) to add a comment.

Attachments: