File tree 1 file changed +7
-9
lines changed
1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -544,10 +544,9 @@ Perl_new_version(pTHX_ SV *ver)
544
544
}
545
545
#ifdef SvVOK
546
546
{
547
- const MAGIC * const mg = SvVSTRING_mg (ver );
548
- if ( mg ) { /* already a v-string */
549
- const STRLEN len = mg -> mg_len ;
550
- const char * const version = (const char * )mg -> mg_ptr ;
547
+ if (SvVOK (ver )) { /* already a v-string */
548
+ STRLEN len ;
549
+ const char * const version = SvVSTRING (ver , len );
551
550
char * raw , * under ;
552
551
static const char underscore [] = "_" ;
553
552
sv_setpvn (rv ,version ,len );
@@ -618,9 +617,6 @@ Perl_upg_version(pTHX_ SV *ver, bool qv)
618
617
#endif
619
618
{
620
619
const char * version , * s ;
621
- #ifdef SvVOK
622
- const MAGIC * mg ;
623
- #endif
624
620
625
621
#if PERL_VERSION_LT (5 ,19 ,8 ) && defined(USE_ITHREADS )
626
622
ENTER ;
@@ -820,8 +816,10 @@ Perl_upg_version(pTHX_ SV *ver, bool qv)
820
816
SvREFCNT_dec (sv );
821
817
}
822
818
#ifdef SvVOK
823
- else if ( (mg = SvVSTRING_mg (ver )) ) { /* already a v-string */
824
- version = savepvn ( (const char * )mg -> mg_ptr ,mg -> mg_len );
819
+ else if (SvVOK (ver )) { /* already a v-string */
820
+ STRLEN len ;
821
+ const char * pv = SvVSTRING (ver , len );
822
+ version = savepvn (pv , len );
825
823
SAVEFREEPV (version );
826
824
qv = TRUE;
827
825
}
You can’t perform that action at this time.
0 commit comments