Signed-off-by: Yves Orton <demerphq@gemini.(none)>
assert(!(flags & ~(SVf_UTF8|SVs_TEMP)));
new_SV(sv);
sv_setpvn(sv,s,len);
- SvFLAGS(sv) |= (flags & SVf_UTF8);
- return (flags & SVs_TEMP) ? sv_2mortal(sv) : sv;
+ SvFLAGS(sv) |= flags;
+
+ if(flags & SVs_TEMP){
+ EXTEND_MORTAL(1);
+ PL_tmps_stack[++PL_tmps_ix] = sv;
+ }
+
+ return sv;
}
/*