Originally, GVs always had something in the SV slot. So, when the
code for $] and $^V started replacing it with another SV, it had to
free the existing SV.
Then commit
c69033f2 came along and added the PERL_DONT_CREATE_GVSV
directive. It necessarily changed a bunch of GvSV()s to GvSVn()s in
gv_fetchpvn_flags. But it changed these two, even though they didn’t
need it. So, when PERL_DONT_CREATE_GVSV is true (the default), we
just create and throw away a scalar needlessly.
break;
case ']': /* $] */
{
- SV * const sv = GvSVn(gv);
+ SV * const sv = GvSV(gv);
if (!sv_derived_from(PL_patchlevel, "version"))
upg_version(PL_patchlevel, TRUE);
GvSV(gv) = vnumify(PL_patchlevel);
break;
case '\026': /* $^V */
{
- SV * const sv = GvSVn(gv);
+ SV * const sv = GvSV(gv);
GvSV(gv) = new_version(PL_patchlevel);
SvREADONLY_on(GvSV(gv));
SvREFCNT_dec(sv);