From: Nicholas Clark Date: Mon, 4 May 2009 21:58:02 +0000 (+0100) Subject: In Perl_gp_dup(), no need to explicitly zero ret->gp_refcnt after the Newxz(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=46d6503777f357c38f9d1cde19b6d3d1c6f36d3d;p=p5sagit%2Fp5-mst-13.2.git In Perl_gp_dup(), no need to explicitly zero ret->gp_refcnt after the Newxz(). --- diff --git a/sv.c b/sv.c index 9d6fddf..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);