summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-02-25 16:48:46 +0000
committerNicholas Clark <nick@ccl4.org>2006-02-25 16:48:46 +0000
commit169d2d72355cfee106217aa142a9e61dc32e53d9 (patch)
tree9d3a981bdf184f258c8f9abe528a2f4cf7930ed3 /op.c
parent584307902de552f84517013f42d1db478f4102bd (diff)
downloadperl-169d2d72355cfee106217aa142a9e61dc32e53d9.tar.gz
Abstract the specific use of SvCUR in GVs for detecting variables on
both sides of an assignment using GvASSIGN_GENERATION() and GvASSIGN_GENERATION_set(). p4raw-id: //depot/perl@27327
Diffstat (limited to 'op.c')
-rw-r--r--op.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/op.c b/op.c
index d65bf1669b..70a2acf76e 100644
--- a/op.c
+++ b/op.c
@@ -3362,9 +3362,10 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right)
if (PL_opargs[curop->op_type] & OA_DANGEROUS) {
if (curop->op_type == OP_GV) {
GV *gv = cGVOPx_gv(curop);
- if (gv == PL_defgv || (int)SvCUR(gv) == PL_generation)
+ if (gv == PL_defgv
+ || (int)GvASSIGN_GENERATION(gv) == PL_generation)
break;
- SvCUR_set(gv, PL_generation);
+ GvASSIGN_GENERATION_set(gv, PL_generation);
}
else if (curop->op_type == OP_PADSV ||
curop->op_type == OP_PADAV ||
@@ -3394,9 +3395,11 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right)
#else
GV *gv = (GV*)((PMOP*)curop)->op_pmreplroot;
#endif
- if (gv == PL_defgv || (int)SvCUR(gv) == PL_generation)
+ if (gv == PL_defgv
+ || (int)GvASSIGN_GENERATION(gv) == PL_generation)
break;
- SvCUR_set(gv, PL_generation);
+ GvASSIGN_GENERATION_set(gv, PL_generation);
+ GvASSIGN_GENERATION_set(gv, PL_generation);
}
}
else