Skip to content

Commit f0540d5

Browse files
committed
Verify we still have a block when climbing lexical stack
Fixes RT #126900 Resolving lexicals in an outer block runs out of blocks if we try to resolve a natively-typed (ex. my int) lexical from within a Perl 6 EVAL
1 parent 630fade commit f0540d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vm/moar/QAST/QASTOperationsMAST.nqp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2659,7 +2659,7 @@ sub try_get_bind_scope($var) {
26592659
my $outer := 0;
26602660
my $block := $*BLOCK;
26612661
my $name := $var.name;
2662-
while nqp::istype($block, BlockInfo) {
2662+
while $block && nqp::istype($block, BlockInfo) {
26632663
last if $block.qast.ann('DYN_COMP_WRAPPER');
26642664
$lex := $block.lexical($name);
26652665
last if $lex;

0 commit comments

Comments
 (0)