X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=sv.c;h=8c9b17abed9a7b250db0fd14ee5ae993c9c9964d;hb=8177d4d97c5035e1ca045371b1be47a2ef66ec1d;hp=7d2eae59505a0a49dd4ab57ed021eb913be07f8e;hpb=e37778c28ba4f7032e74888c10d3a8b367d2b4c4;p=p5sagit%2Fp5-mst-13.2.git diff --git a/sv.c b/sv.c index 7d2eae5..8c9b17a 100644 --- a/sv.c +++ b/sv.c @@ -10495,7 +10495,8 @@ Perl_gp_dup(pTHX_ GP *const gp, CLONE_PARAMS *const param) ptr_table_store(PL_ptr_table, gp, ret); /* clone */ - ret->gp_refcnt = 0; /* must be before any other dups! */ + /* ret->gp_refcnt must be 0 before any other dups are called. We're relying + on Newxz() to do this for us. */ ret->gp_sv = sv_dup_inc(gp->gp_sv, param); ret->gp_io = io_dup_inc(gp->gp_io, param); ret->gp_form = cv_dup_inc(gp->gp_form, param); @@ -10954,8 +10955,7 @@ Perl_sv_dup(pTHX_ const SV *const sstr, CLONE_PARAMS *const param) LvTARG(dstr) = sv_dup_inc(LvTARG(dstr), param); case SVt_PVGV: if(isGV_with_GP(sstr)) { - if (GvNAME_HEK(dstr)) - GvNAME_HEK(dstr) = hek_dup(GvNAME_HEK(dstr), param); + GvNAME_HEK(dstr) = hek_dup(GvNAME_HEK(dstr), param); /* Don't call sv_add_backref here as it's going to be created as part of the magic cloning of the symbol table. */ @@ -11053,7 +11053,7 @@ Perl_sv_dup(pTHX_ const SV *const sstr, CLONE_PARAMS *const param) SvFLAGS(dstr) |= SVf_OOK; hvname = saux->xhv_name; - daux->xhv_name = hvname ? hek_dup(hvname, param) : hvname; + daux->xhv_name = hek_dup(hvname, param); daux->xhv_riter = saux->xhv_riter; daux->xhv_eiter = saux->xhv_eiter