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

[perl #38724] Tailcalls into the PIR Compiler are Broken

0 views
Skip to first unread message

Matt Diephouse

unread,
Mar 13, 2006, 11:32:11 PM3/13/06
to bugs-bi...@rt.perl.org
# New Ticket Created by Matt Diephouse
# Please include the string: [perl #38724]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=38724 >


mdiep@dissonance:~/parrot$ cat test.pir
.sub main :main
$P0 = eval("print \"Foo!\\n\"")
$P0()
end
.end

.sub eval
.param string code

code = ".sub main :main :anon\n" . code
code = code . "\n.end\n"

$P0 = compreg "PIR"

.return $P0(code)
.end
mdiep@dissonance:~/parrot$ parrot test.pir
attempt to access code outside of current code segment
mdiep@dissonance:~/parrot$

This was the cause of some trouble recently for Partcl (although I
didn't get the "attempt to access" error message given here - just
some weird behavior (I think the return jumped to a different
coroutine)).

--
Matt Diephouse

Leopold Toetsch

unread,
Mar 14, 2006, 7:21:13 AM3/14/06
to perl6-i...@perl.org, bugs-bi...@netlabs.develooper.com
Matt Diephouse (via RT) wrote:

> $P0 = compreg "PIR"
>
> .return $P0(code)
> .end
> mdiep@dissonance:~/parrot$ parrot test.pir
> attempt to access code outside of current code segment
> mdiep@dissonance:~/parrot$
>
> This was the cause of some trouble recently for Partcl (although I
> didn't get the "attempt to access" error message given here - just
> some weird behavior (I think the return jumped to a different
> coroutine)).

Well, the runloop continued after the next statement, which for sure can
give nice effects.

Anyway, this is fixed now (r11896) and the example added as another
tailcall test. Thanks for tracking down the issue.

leo

0 new messages