Skip to content

Commit

Permalink
Fix leakage of lowered/flattened lexicals
Browse files Browse the repository at this point in the history
This can only happen because things like throws-like are naughty with
contexts; an actual EVAL would never really leak the context. This fixes
a spectest regression thanks to the more aggressive block flattening.
  • Loading branch information
jnthn committed Jan 8, 2019
1 parent d2df5b8 commit 7fb098d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Perl6/World.nqp
Expand Up @@ -368,7 +368,13 @@ class Perl6::World is HLL::World {
$i := $i - 1;
my %sym := @!PADS[$i].symbol($name);
if +%sym {
return %sym<scope> eq 'lexical';
return %sym<scope> eq 'lexical' &&
# Make sure it's now a lowered away lexical from a flattened
# inner scope in an EVAL in the REPL
($i > 0 || nqp::iscclass(nqp::const::CCLASS_ALPHABETIC, $name, 0) ||
!nqp::istype(
$*W.force_value(%sym, $name, 0),
$*W.find_symbol(['Rakudo', 'Internals', 'LoweredAwayLexical'])));
}
}
0;
Expand Down

0 comments on commit 7fb098d

Please sign in to comment.