From: Jarkko Hietaniemi Date: Tue, 20 Feb 2001 17:36:53 +0000 (+0000) Subject: Integrate pureperl changes #8844,8845,8850 to mainline X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=65c5011456bf74c702f7584e00961bc2bf3ea4f1;p=p5sagit%2Fp5-mst-13.2.git Integrate pureperl changes #8844,8845,8850 to mainline (via maintperl #8855). Fixed %^H scoping bug Removed GV <-> CV refcount loop Removed %ENV refcount loop p4raw-link: @8850 on //depot/maint-5.6/pureperl: bae1eca58b94313e4b7677aa241da9fad57bb363 p4raw-link: @8845 on //depot/maint-5.6/pureperl: 4d40626c12bbdd62acfbbe3be104711e58cec2f7 p4raw-link: @8844 on //depot/maint-5.6/pureperl: ea100fc6cfd2f0e23aceb84ac0e804e3c9c3c9a2 p4raw-id: //depot/perl@8858 p4raw-integrated: from //depot/maint-5.6/perl@8857 'merge in' gv.c scope.c (@8606..) pp.c (@8635..) op.c (@8758..) perl.c (@8806..) --- diff --git a/gv.c b/gv.c index 4d51811..0d34366 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 edafe02..af7221e 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 7dc4902..a2538fe 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 ae2ff93..a0361da 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 5275935..f0efaf8 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: