diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-10-24 21:38:01 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-10-24 21:46:13 -0700 |
commit | 96801525df66a32483d0872bdbfffea111d7add5 (patch) | |
tree | 7d18d6a8e4bc6ce182cd952041b1fb53f252a054 /perly.y | |
parent | d40610d16eaa2c4551c2284e77d67581fc9ac258 (diff) | |
download | perl-96801525df66a32483d0872bdbfffea111d7add5.tar.gz |
Remove redundant op_lvalue calls in perly.y
When (\$x)=\$y is compiled, the \ on the lhs gives lvalue context to
its argument by calling op_lvalue. Then later the = gives lvalue con-
text to the \, calling op_lvalue again, which transforms the $x into
an lvref op (via op.c:S_lvref).
I just copied that logic when I extended aliasing via reference to
foreach \$x. But here, we don’t need to call op_lvalue on the $x,
because we know it is going to go through op.c:S_lvref, which doesn’t
care whether it has been through op_lvalue already or not. The end
result is the same.
Diffstat (limited to 'perly.y')
-rw-r--r-- | perly.y | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -388,8 +388,7 @@ barestmt: PLUGSTMT newFOROP(0, op_lvalue( newUNOP(OP_REFGEN, 0, - op_lvalue($<opval>6, - OP_REFGEN)), + $<opval>6), OP_ENTERLOOP), $8, $10, $11) ); @@ -399,8 +398,7 @@ barestmt: PLUGSTMT { $$ = block_end($5, newFOROP( 0, op_lvalue(newUNOP(OP_REFGEN, 0, - op_lvalue($3, - OP_REFGEN)), + $3), OP_ENTERLOOP), $6, $8, $9)); parser->copline = (line_t)$1; } |