Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Protect range optimizer from not having a block
Fixes the LTA error vendethiel++ found: *.say for ^10
  • Loading branch information
lizmat committed Dec 27, 2014
1 parent 7ea485c commit c5e7a77
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Perl6/Optimizer.nqp
Expand Up @@ -1380,10 +1380,13 @@ class Perl6::Optimizer {
}

method optimize_for_range($op, $c2) {
my $block := $!symbols.Block;
unless nqp::defined($block) { return };

my $callee := $op[0][1];
my $code := $callee.ann('code_object');
my $count := $code.count;
my $phasers := nqp::getattr($code, $!symbols.Block, '$!phasers');
my $phasers := nqp::getattr($code, $block, '$!phasers');
if $count == 1 && nqp::isnull($phasers) && %range_bounds{$c2.name}($c2) -> @bounds {
my $it_var := QAST::Node.unique('range_it_');
my $callee_var := QAST::Node.unique('range_callee_');
Expand Down

0 comments on commit c5e7a77

Please sign in to comment.