Creation of the mortal can be done with newSVpvn_flags(), saving 1 function
call. Also, the mortal stack uses 1 pointer, whereas the save stack will use 2.
It doesn't matter that dstr is now marked SVs_TEMP, as both code paths already
gut it, stealing its SvPVX(). The SV head will happen to last a bit longer now,
to the next FREETMPS, instead of the the scope pop at the end of pp_subst or
pp_substcont.
#endif
if (RX_MATCH_TAINTED(rx)) /* run time pattern taint, eg locale */
rxtainted |= SUBST_TAINT_PAT;
- dstr = newSVpvn_utf8(m, s-m, DO_UTF8(TARG));
- SAVEFREESV(dstr);
+ dstr = newSVpvn_flags(m, s-m, SVs_TEMP | (DO_UTF8(TARG) ? SVf_UTF8 : 0));
PL_curpm = pm;
if (!c) {
register PERL_CONTEXT *cx;