#1029: taillcall into PIR compiler broken
--------------------+-------------------------------------------------------
Reporter: coke | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: none | Version: trunk
Severity: high | Keywords:
Lang: perl6 | Patch:
Platform: |
--------------------+-------------------------------------------------------
See [http://rt.perl.org/rt3/Ticket/Display.html?id=51206 Original RT]
If you apply this patch to parrot:
{{{
index 776a062..4f1486f 100644
--- a/compilers/pct/src/PCT/HLLCompiler.pir
+++ b/compilers/pct/src/PCT/HLLCompiler.pir
@@ -512,8 +512,7 @@ Transform PAST C<source> into POST.
.param pmc adverbs :slurpy :named
$P0 = compreg 'PIR'
- $P1 = $P0(source)
- .return ($P1)
+ .tailcall $P0(source)
.end
}}}
This causes failures in rakudo. For example, "class {}" without the patch
returns nothing in interactive mode, but with the patch, it returns a
failure regarding the # of arguments expected.
A simple test of the tailcall (below) doesn't show this behavior.
{{{
.sub main
$P1 = elm()
$P1()
.end
.sub elm
$P1 = compreg 'PIR'
$S0 =<<'END_PIR'
.sub foo
say 'ok'
.end
END_PIR
.tailcall $P1($S0)
.end
}}}
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/1029>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets