Skip to content

Commit

Permalink
Fix insufficient cloning in given/when/default.
Browse files Browse the repository at this point in the history
This could lead to lexicals bleeding between threads.
  • Loading branch information
jnthn committed Jun 9, 2015
1 parent 2aad0b2 commit 636bd32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Perl6/Actions.nqp
Expand Up @@ -1345,6 +1345,7 @@ Compilation unit '$file' contained the following violations:
method statement_control:sym<given>($/) {
my $past := $<xblock>.ast;
$past.push($past.shift); # swap [0] and [1] elements
$past[0] := block_closure($past[0]);
$past.op('call');
make $past;
}
Expand Down Expand Up @@ -7102,8 +7103,8 @@ Compilation unit '$file' contained the following violations:
}

# if this is not an immediate block create a call
if ($when_block.ann('past_block')) {
$when_block := QAST::Op.new( :op('call'), $when_block);
if $when_block.ann('past_block') {
$when_block := QAST::Op.new( :op('call'), block_closure($when_block) );
}

# call succeed with the block return value, succeed will throw
Expand Down

0 comments on commit 636bd32

Please sign in to comment.