case '\026': /* $^V */
if (len == 1) {
SV *sv = GvSV(gv);
- sv = new_version(PL_patchlevel);
- SvREADONLY_on(sv);
- GvSV(gv) = sv;
+ GvSV(gv) = new_version(PL_patchlevel);
+ SvREADONLY_on(GvSV(gv));
+ SvREFCNT_dec(sv);
}
break;
}
bool saw_under = 0;
SV* sv = newSVrv(rv, "version"); /* create an SV and upgrade the RV */
(void)sv_upgrade(sv, SVt_PVAV); /* needs to be an AV type */
+ AvREAL_on((AV*)sv);
/* pre-scan the imput string to check for decimals */
while ( *pos == '.' || *pos == '_' || isDIGIT(*pos) )
AV *av = (AV *)SvRV(ver);
SV* sv = newSVrv(rv, "version"); /* create an SV and upgrade the RV */
(void)sv_upgrade(sv, SVt_PVAV); /* needs to be an AV type */
+ AvREAL_on((AV*)sv);
for ( key = 0; key <= av_len(av); key++ )
{
I32 rev = SvIV(*av_fetch(av, key, FALSE));