Skip to content

Commit

Permalink
Fix a bug in the optimer where to optimalization where improperly com…
Browse files Browse the repository at this point in the history
…bining

This was causing problems on the js and jvm backend.
When optimizing $var += ... into nqp::assign_i($var, $var + ...) $var was
being used twice.
When optimizing $var + ... and turning $var from lexicalref to lexical $var use
in nqp::assign_i($var, ...) was also affected.
  • Loading branch information
pmurias committed Sep 6, 2018
1 parent 4420ed4 commit 8d9b312
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Perl6/Optimizer.nqp
Expand Up @@ -2006,7 +2006,9 @@ class Perl6::Optimizer {
else {
return NQPMu;
}
$assignee := $assignee_var := $op[1];
$assignee := $op[1];
# other optimizations might want to change this independently
$assignee_var := nqp::clone($op[1]);
}
else {
$assignop := 'p6store';
Expand Down

0 comments on commit 8d9b312

Please sign in to comment.