Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix double-evaluation bug in | found by japhb++.
  • Loading branch information
jnthn committed Oct 28, 2011
1 parent 1be6534 commit 9c6aedb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Perl6/Actions.pm
Expand Up @@ -2767,12 +2767,18 @@ class Perl6::Actions is HLL::Actions {
}
}
elsif $_ ~~ PAST::Op && $_.name eq '&prefix:<|>' {
my $reg := $past.unique('flattening_');
$past.push(PAST::Op.new(
:pasttype('callmethod'), :name('FLATTENABLE_LIST'),
$_[0], :flat(1)));
PAST::Op.new(
:pasttype('bind'),
PAST::Var.new( :name($reg), :scope('register'), :isdecl(1) ),
$_[0]),
:flat(1) ));
$past.push(PAST::Op.new(
:pasttype('callmethod'), :name('FLATTENABLE_HASH'),
$_[0], :flat(1), :named(1)));
PAST::Var.new( :name($reg), :scope('register') ),
:flat(1), :named(1) ));
}
else {
$past.push($_);
Expand Down

0 comments on commit 9c6aedb

Please sign in to comment.