Skip to content

Commit

Permalink
A slightly more correct handling of ^10 .reverse
Browse files Browse the repository at this point in the history
We should first check for the .reverse, *the* check for nqp::stmts
  • Loading branch information
lizmat committed Sep 24, 2018
1 parent 2dd0275 commit 645eeb5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Perl6/Optimizer.nqp
Expand Up @@ -1114,15 +1114,15 @@ class Perl6::Optimizer {
if ($optype eq 'p6for' || $optype eq 'p6forstmt') && $op.sunk && @($op) == 2 {
my $reverse := 0;
my $theop := $op[0];
if nqp::istype($theop, QAST::Stmts) {
$theop := $theop[0]
}
elsif nqp::istype($theop, QAST::Op)
if nqp::istype($theop, QAST::Op)
&& $theop.op eq 'callmethod'
&& $theop.name eq 'reverse' {
$reverse := 1;
$theop := $theop[0];
}
if nqp::istype($theop, QAST::Stmts) {
$theop := $theop[0]
}

if nqp::istype($theop, QAST::Op)
&& nqp::existskey(%range_bounds, $theop.name)
Expand Down

0 comments on commit 645eeb5

Please sign in to comment.