diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-10-05 15:56:15 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-10-05 15:56:15 -0700 |
commit | 108cb980748a75d7c8170cfaf25dbda9c56f6717 (patch) | |
tree | 4bde757e8d422ad98e3df163e314cf0bdd82437f /sv.h | |
parent | 9c1fdeb11a8ed6c719b1d6e13f6ab14d9e2863b1 (diff) | |
download | perl-108cb980748a75d7c8170cfaf25dbda9c56f6717.tar.gz |
[perl #79824] Don’t cow for sv_mortalcopy call from XS
XS code doing sv_mortalcopy(sv) will expect to get a true copy, and
not a COW ‘copy’.
So make sv_mortalcopy and wrapper around the new sv_mortalcopy_flags
that passes it SV_DO_COW_SVSETSV, which is defined as 0 for XS code.
Diffstat (limited to 'sv.h')
-rw-r--r-- | sv.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -1805,6 +1805,8 @@ mg.c:1024: warning: left-hand operand of comma expression has no effect #define sv_insert(bigstr, offset, len, little, littlelen) \ Perl_sv_insert_flags(aTHX_ (bigstr),(offset), (len), (little), \ (littlelen), SV_GMAGIC) +#define sv_mortalcopy(sv) \ + Perl_sv_mortalcopy_flags(aTHX_ sv, SV_GMAGIC|SV_DO_COW_SVSETSV) /* Should be named SvCatPVN_utf8_upgrade? */ #define sv_catpvn_nomg_utf8_upgrade(dsv, sstr, slen, nsv) \ |