This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perly.y: Don’t call op_lvalue on refgen kid
authorFather Chrysostomos <sprout@cpan.org>
Tue, 6 Jan 2015 05:41:26 +0000 (21:41 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 6 Jan 2015 14:39:32 +0000 (06:39 -0800)
ck_spair also applies lvalue context to the kid ops, so we just end up
calling op_lvalue twice on the same ops.  It’s harmless (being idempo-
tent), but wasteful.

perly.act
perly.h
perly.tab
perly.y

index f5a78f3..638818e 100644 (file)
--- a/perly.act
+++ b/perly.act
@@ -1078,7 +1078,7 @@ case 2:
 
   case 168:
 #line 860 "perly.y"
-    { (yyval.opval) = newUNOP(OP_REFGEN, 0, op_lvalue((ps[(2) - (2)].val.opval),OP_REFGEN)); ;}
+    { (yyval.opval) = newUNOP(OP_REFGEN, 0, (ps[(2) - (2)].val.opval)); ;}
     break;
 
   case 169:
@@ -1502,6 +1502,6 @@ case 2:
     
 
 /* Generated from:
- * 0c499ecc5892868c1d5acd74ecc34b917f3c7fc5aa57d93b01ecd12f4a0f7a8b perly.y
+ * 742ccd162893f72458d7102c054eda970bae7a1de1a02b75fb23afc88e332e7f perly.y
  * d1d4df7b8e30ac9dede664af9179e6e5e7ddc7f2ad9c4eff9e2e5b32c9e16a6e regen_perly.pl
  * ex: set ro: */
diff --git a/perly.h b/perly.h
index 370093a..8bd1f4b 100644 (file)
--- a/perly.h
+++ b/perly.h
@@ -256,6 +256,6 @@ typedef union YYSTYPE
 
 
 /* Generated from:
- * 0c499ecc5892868c1d5acd74ecc34b917f3c7fc5aa57d93b01ecd12f4a0f7a8b perly.y
+ * 742ccd162893f72458d7102c054eda970bae7a1de1a02b75fb23afc88e332e7f perly.y
  * d1d4df7b8e30ac9dede664af9179e6e5e7ddc7f2ad9c4eff9e2e5b32c9e16a6e regen_perly.pl
  * ex: set ro: */
index 7a56380..cab9b28 100644 (file)
--- a/perly.tab
+++ b/perly.tab
@@ -1140,6 +1140,6 @@ static const toketypes yy_type_tab[] =
 };
 
 /* Generated from:
- * 0c499ecc5892868c1d5acd74ecc34b917f3c7fc5aa57d93b01ecd12f4a0f7a8b perly.y
+ * 742ccd162893f72458d7102c054eda970bae7a1de1a02b75fb23afc88e332e7f perly.y
  * d1d4df7b8e30ac9dede664af9179e6e5e7ddc7f2ad9c4eff9e2e5b32c9e16a6e regen_perly.pl
  * ex: set ro: */
diff --git a/perly.y b/perly.y
index 99ee27b..e575b70 100644 (file)
--- a/perly.y
+++ b/perly.y
@@ -857,7 +857,7 @@ term        :       termbinop
        |       term '?' term ':' term
                        { $$ = newCONDOP(0, $1, $3, $5); }
        |       REFGEN term                          /* \$x, \@y, \%z */
-                       { $$ = newUNOP(OP_REFGEN, 0, op_lvalue($2,OP_REFGEN)); }
+                       { $$ = newUNOP(OP_REFGEN, 0, $2); }
        |       myattrterm      %prec UNIOP
                        { $$ = $1; }
        |       LOCAL term      %prec UNIOP