summaryrefslogtreecommitdiff
path: root/regen
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-08-17 16:47:04 +0100
committerDavid Mitchell <davem@iabyn.com>2015-08-19 08:52:54 +0100
commitb13702a2b676b84fd7641c481a27970b9259f5ff (patch)
treec057beb120dea4fe32ac1f78ee76bddb65ec710d /regen
parent92792a1c986f2a3bca788ec0500359ab8a53cc39 (diff)
downloadperl-b13702a2b676b84fd7641c481a27970b9259f5ff.tar.gz
ck_refassign: selectively copy OPpPAD_INTRO/STATE
Previously this function unconditionally copied the OPpLVAL_INTRO and OPpPAD_STATE flags from the LH var op to the refassign op, even when those flag bits weren't used or meant something different. This commit makes the copying more selective. It also makes clear by code comments and asserts, that the refassign op uses bit 6, OPpPAD_STATE, to mean either that or OPpOUR_INTRO depending on the type of LHS. I couldn't think of any test that would would break under the old regime, but this future-proofs the code against new flags and meanings.
Diffstat (limited to 'regen')
-rw-r--r--regen/op_private6
1 files changed, 6 insertions, 0 deletions
diff --git a/regen/op_private b/regen/op_private
index 54980f0630..51e01b6ccc 100644
--- a/regen/op_private
+++ b/regen/op_private
@@ -477,6 +477,11 @@ addbits($_, 7 => qw(OPpPV_IS_UTF8 UTF)) for qw(last redo next goto dump);
+# note that for refassign, this bit can mean either OPpPAD_STATE or
+# OPpOUR_INTRO depending on the type of the LH child, .e.g.
+# \our $foo = ...
+# \state $foo = ...
+
addbits($_, 6 => qw(OPpPAD_STATE STATE)) for qw(padav padhv padsv lvavref
lvref refassign pushmark);
@@ -748,6 +753,7 @@ addbits($_,
3 OPpLVREF_CV CV
)],
},
+ #6 => qw(OPpPAD_STATE STATE),
#7 => qw(OPpLVAL_INTRO LVINTRO),
) for 'refassign', 'lvref';