Ticket #1029 (closed bug: fixed)
taillcall into PIR compiler broken
Reported by: | coke | Owned by: | whiteknight |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | none | Version: | trunk |
Severity: | high | Keywords: | |
Cc: | Language: | perl6 | |
Patch status: | Platform: | all |
Description
See 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
Change History
Note: See
TracTickets for help on using
tickets.