From: Nicholas Clark Date: Thu, 13 Jan 2005 23:13:05 +0000 (+0000) Subject: Use the new SV_NOSTEAL flag to avoid the SvTEMP dance in newSVsv X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e90aabebafdd77f6f0dc6cf0b24db209e9442e31;p=p5sagit%2Fp5-mst-13.2.git Use the new SV_NOSTEAL flag to avoid the SvTEMP dance in newSVsv p4raw-id: //depot/perl@23797 --- diff --git a/sv.c b/sv.c index b1edb2f..e9e0eca 100644 --- a/sv.c +++ b/sv.c @@ -7858,13 +7858,10 @@ Perl_newSVsv(pTHX_ register SV *old) return Nullsv; } new_SV(sv); - if (SvTEMP(old)) { - SvTEMP_off(old); - sv_setsv(sv,old); - SvTEMP_on(old); - } - else - sv_setsv(sv,old); + /* SV_GMAGIC is the default for sv_setv() + SV_NOSTEAL prevents TEMP buffers being, well, stolen, and saves games + with SvTEMP_off and SvTEMP_on round a call to sv_setsv. */ + sv_setsv_flags(sv, old, SV_GMAGIC | SV_NOSTEAL); return sv; }