summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gv.c2
-rw-r--r--op.c9
-rw-r--r--perl.c2
-rw-r--r--pp.c2
-rw-r--r--scope.c4
5 files changed, 7 insertions, 12 deletions
diff --git a/gv.c b/gv.c
index 4d51811600..0d34366e4f 100644
--- a/gv.c
+++ b/gv.c
@@ -125,7 +125,7 @@ Perl_gv_init(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, int multi)
LEAVE;
PL_sub_generation++;
- CvGV(GvCV(gv)) = (GV*)SvREFCNT_inc(gv);
+ CvGV(GvCV(gv)) = gv;
CvFILE(GvCV(gv)) = CopFILE(PL_curcop);
CvSTASH(GvCV(gv)) = PL_curstash;
#ifdef USE_THREADS
diff --git a/op.c b/op.c
index edafe0299f..af7221e2c9 100644
--- a/op.c
+++ b/op.c
@@ -4155,7 +4155,6 @@ Perl_cv_undef(pTHX_ CV *cv)
}
SvPOK_off((SV*)cv); /* forget prototype */
CvFLAGS(cv) = 0;
- SvREFCNT_dec(CvGV(cv));
CvGV(cv) = Nullgv;
SvREFCNT_dec(CvOUTSIDE(cv));
CvOUTSIDE(cv) = Nullcv;
@@ -4268,7 +4267,7 @@ S_cv_clone2(pTHX_ CV *proto, CV *outside)
CvOWNER(cv) = 0;
#endif /* USE_THREADS */
CvFILE(cv) = CvFILE(proto);
- CvGV(cv) = (GV*)SvREFCNT_inc(CvGV(proto));
+ CvGV(cv) = CvGV(proto);
CvSTASH(cv) = CvSTASH(proto);
CvROOT(cv) = CvROOT(proto);
CvSTART(cv) = CvSTART(proto);
@@ -4678,7 +4677,7 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
PL_sub_generation++;
}
}
- CvGV(cv) = (GV*)SvREFCNT_inc(gv);
+ CvGV(cv) = gv;
CvFILE(cv) = CopFILE(PL_curcop);
CvSTASH(cv) = PL_curstash;
#ifdef USE_THREADS
@@ -4954,7 +4953,7 @@ Perl_newXS(pTHX_ char *name, XSUBADDR_t subaddr, char *filename)
PL_sub_generation++;
}
}
- CvGV(cv) = (GV*)SvREFCNT_inc(gv);
+ CvGV(cv) = gv;
#ifdef USE_THREADS
New(666, CvMUTEXP(cv), 1, perl_mutex);
MUTEX_INIT(CvMUTEXP(cv));
@@ -5045,7 +5044,7 @@ Perl_newFORM(pTHX_ I32 floor, OP *o, OP *block)
}
cv = PL_compcv;
GvFORM(gv) = cv;
- CvGV(cv) = (GV*)SvREFCNT_inc(gv);
+ CvGV(cv) = gv;
CvFILE(cv) = CopFILE(PL_curcop);
for (ix = AvFILLp(PL_comppad); ix > 0; ix--) {
diff --git a/perl.c b/perl.c
index 7dc4902502..a2538fe5c6 100644
--- a/perl.c
+++ b/perl.c
@@ -3326,7 +3326,7 @@ S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register
HV *hv;
GvMULTI_on(PL_envgv);
hv = GvHVn(PL_envgv);
- hv_magic(hv, PL_envgv, 'E');
+ hv_magic(hv, Nullgv, 'E');
#ifdef USE_ENVIRON_ARRAY
/* Note that if the supplied env parameter is actually a copy
of the global environ then it may now point to free'd memory
diff --git a/pp.c b/pp.c
index ae2ff93ad6..a0361da954 100644
--- a/pp.c
+++ b/pp.c
@@ -834,7 +834,7 @@ PP(pp_undef)
case SVt_PVFM:
{
/* let user-undef'd sub keep its identity */
- GV* gv = (GV*)SvREFCNT_inc(CvGV((CV*)sv));
+ GV* gv = CvGV((CV*)sv);
cv_undef((CV*)sv);
CvGV((CV*)sv) = gv;
}
diff --git a/scope.c b/scope.c
index 527593542c..f0efaf82e0 100644
--- a/scope.c
+++ b/scope.c
@@ -912,10 +912,6 @@ Perl_leave_scope(pTHX_ I32 base)
PL_op = (OP*)SSPOPPTR;
break;
case SAVEt_HINTS:
- if (GvHV(PL_hintgv)) {
- SvREFCNT_dec((SV*)GvHV(PL_hintgv));
- GvHV(PL_hintgv) = NULL;
- }
*(I32*)&PL_hints = (I32)SSPOPINT;
break;
case SAVEt_COMPPAD: