diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-01-13 23:13:05 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-01-13 23:13:05 +0000 |
commit | e90aabebafdd77f6f0dc6cf0b24db209e9442e31 (patch) | |
tree | b6f24e14cad5322e2487c6749cbbc64fdee9a413 /sv.c | |
parent | 243b1711e6dba4a348cef9fff90e6aa6a8a4d0ea (diff) | |
download | perl-e90aabebafdd77f6f0dc6cf0b24db209e9442e31.tar.gz |
Use the new SV_NOSTEAL flag to avoid the SvTEMP dance in newSVsv
p4raw-id: //depot/perl@23797
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -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; } |