Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

exceptions

8 views
Skip to first unread message

William Coleda

unread,
Nov 21, 2004, 12:26:47 PM11/21/04
to Perl 6 Internals
I just noticed some test failures in the tcl suite.

Looks like the following code:

print "HERE?\n"
set_eh ignore
find_lex lexical, -1, var
clear_eh

Does the following at runtime:

3713 print "HERE?\n"
HERE?
3715 set_eh P20 - P20=Exception_Handler=PMC(0xf8eb30)
3717 find_lex P18, -1, S17 - P18=Array=PMC(0xf8eb48), , S17="b"

And just stops. Exit code 0.

Here's my exception handler:

.namespace [ "_Tcl"]
.emit
__default_handler:
set P4, P5["_invoke_cc"]
set P5, P5["_P5"]
invoke P4
.eom


And here's where I define the invoke pmc used above:

.local pmc ignore
newsub ignore, .Exception_Handler, __default_handler


Any ideas?

Leopold Toetsch

unread,
Nov 21, 2004, 1:54:41 PM11/21/04
to William Coleda, perl6-i...@perl.org
William Coleda <wi...@coleda.com> wrote:
> I just noticed some test failures in the tcl suite.

exception syntax will change slightly.

> set P4, P5["_invoke_cc"]

especially these constructs (resumable handling).
Please use currently a local handler:

newsub ignore, .Exception_Handler, catch
set_eh ignore
# ops that might fail
clear_eh
catch:

Even better, stuff above 2 handler install lines into a macro, as the
syntax will likely be:

new ignore, .Exception_Handler
push_eh ignore, catch

leo

William Coleda

unread,
Nov 21, 2004, 4:42:24 PM11/21/04
to l...@toetsch.at, perl6-i...@perl.org
I switched to local exception handler blocks, and am still getting the same failure mode.

Of course, it works fine in a simple, single file example.

I've checked everything back in so you can take a look. Once you build tcl, from the top level directory, try:

oolong:~/research/parrot_8075 coke$ cat error.tcl
set a(b) 2
puts $a(b)

This SHOULD trigger the exception handler in languages/tcl/lib/command/set.imc. Instead, the stack trace ends with:

3718 set_eh P20 - P20=Exception_Handler=PMC(0x401b5d8)
3720 find_lex P18, -1, S17 - P18=Array=PMC(0x401b578), , S17="a"

And, again, exit value of 0.

Leopold Toetsch

unread,
Nov 22, 2004, 10:39:54 AM11/22/04
to William Coleda, perl6-i...@perl.org
William Coleda <wi...@coleda.com> wrote:

> This SHOULD trigger the exception handler in
> languages/tcl/lib/command/set.imc. Instead, the stack trace ends with:

> 3718 set_eh P20 - P20=Exception_Handler=PMC(0x401b5d8)
> 3720 find_lex P18, -1, S17 - P18=Array=PMC(0x401b578), , S17="a"

> And, again, exit value of 0.

Exception handling is/was wrong, when multiple run loops are involved.
My fix for that was broken. I'll redo that along with the other changes
from Dan's exception paper.

For now the tcl code works, the one test is disabled.

leo

0 new messages