@@ -4634,7 +4634,7 @@ Perl_sv_setsv_flags(pTHX_ SV *dsv, SV* ssv, const I32 flags)
4634
4634
4635
4635
(void)SvOK_off(dsv);
4636
4636
SvFLAGS(dsv) |= sflags &
4637
- (SVf_POK|SVp_POK|SVf_IOK|SVp_IOK|SVf_NOK|SVp_NOK|SVf_UTF8);
4637
+ (SVf_POK|SVp_POK|SVf_IOK|SVp_IOK|SVf_IVisUV| SVf_NOK|SVp_NOK|SVf_UTF8);
4638
4638
4639
4639
if ( !(flags & SV_NOSTEAL) && S_SvPV_can_swipe_buf(ssv, sflags, cur, len) )
4640
4640
{ /* Passes the swipe test. */
@@ -4733,8 +4733,6 @@ Perl_sv_setsv_flags(pTHX_ SV *dsv, SV* ssv, const I32 flags)
4733
4733
}
4734
4734
if (sflags & SVp_IOK) {
4735
4735
SvIV_set(dsv, SvIVX(ssv));
4736
- if (sflags & SVf_IVisUV)
4737
- SvIsUV_on(dsv);
4738
4736
if ((sflags & SVf_IOK) && !(sflags & SVf_POK)) {
4739
4737
/* Source was SVf_IOK|SVp_IOK|SVp_POK but not SVf_POK, meaning
4740
4738
a value set as an integer and later stringified. So confirm
@@ -4800,9 +4798,10 @@ S_sv_freshcopy_POK(pTHX_ SV* dsv, SV* ssv, const I32 flags)
4800
4798
4801
4799
if (!(flags & SV_NOSTEAL) && S_SvPV_can_swipe_buf(ssv, sflags, cur, len) ) {
4802
4800
/* Passes the swipe test. */
4801
+ char * buf = SvPVX_mutable(ssv);
4803
4802
SvLEN_set(dsv, len);
4804
4803
SvCUR_set(dsv, cur);
4805
- SvPV_set(dsv, SvPVX_mutable(ssv) );
4804
+ SvPV_set(dsv, buf );
4806
4805
4807
4806
assert(!SvOOK(ssv)); /* According to S_SvPV_can_swipe_buf() */
4808
4807
/* (void)SvOK_off(ssv); but without the superfluous SvOOK_off(ssv)) */
@@ -5131,12 +5130,12 @@ Perl_sv_freshcopy_flags(pTHX_ SV *const old, I32 flags)
5131
5130
break;
5132
5131
case SVt_IV|SVf_ROK: /* [12%] */
5133
5132
assert(SvANY(dsv));
5133
+ SvFLAGS(dsv) = SVt_IV|SVf_ROK;
5134
5134
#if defined (DEBUGGING) || defined (PERL_DEBUG_COW)
5135
- dsv->sv_u.svu_rv = SvREFCNT_inc (SvRV(old));
5135
+ dsv->sv_u.svu_rv = SvREFCNT_inc_NN (SvRV(old));
5136
5136
#else
5137
- dsv->sv_u.svu_rv = SvREFCNT_inc ( old->sv_u.svu_rv );
5137
+ dsv->sv_u.svu_rv = SvREFCNT_inc_NN ( old->sv_u.svu_rv );
5138
5138
#endif
5139
- SvFLAGS(dsv) = SVt_IV|SVf_ROK;
5140
5139
break;
5141
5140
case SVt_PV|SVf_POK: /* [32%] */
5142
5141
SvANY(dsv) = new_XPV();
0 commit comments