Skip to content
Permalink
Browse files

Fix leakage of lowered/flattened lexicals

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 7fb098d7d17188e5d3ee2caf4ce1485ffa1b8133
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/Perl6/World.nqp
@@ -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;

0 comments on commit 7fb098d

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