Skip to content
Permalink
Browse files

Do not copy $_ upon immediate block inlining

Otherwise, in some circumstances, it can lead to lexical accesses
that were meant to read outer $_ reading the lowered stub one. This
addresses the second issue that was reported in #2601.
  • Loading branch information...
jnthn committed Jan 15, 2019
1 parent 623450d commit 08d87f706106fc1bafd562ab9ac66c76309c983a
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/Perl6/Optimizer.nqp
@@ -3002,7 +3002,7 @@ class Perl6::Optimizer {
# a symbol, do nothing (we just need it for "fallback" purposes).
# Otherwise, copy it and register it in the outer.
my $name := $_.name;
unless $name eq '$*DISPATCHER' || $outer.symbol($name) {
unless $name eq '$*DISPATCHER' || $name eq '$_' || $outer.symbol($name) {
@copy_decls.push($_);
$outer.symbol($name, :scope('lexical'));
}

0 comments on commit 08d87f7

Please sign in to comment.
You can’t perform that action at this time.