summaryrefslogtreecommitdiff
path: root/ext/XS-APItest/APItest.xs
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-12-12 15:26:01 -0800
committerFather Chrysostomos <sprout@cpan.org>2014-01-16 17:58:37 -0800
commita4d7a71bfbcf858b69074d4736f0d350903d6779 (patch)
tree2e8439e4589e276f44dceab38be5865ac8a1feff /ext/XS-APItest/APItest.xs
parent83d6f158711260fab9a16e49203c65f2ba4fb00e (diff)
downloadperl-a4d7a71bfbcf858b69074d4736f0d350903d6779.tar.gz
XS::APItest: Flatten src for utf16_to_utf8_reversed
utf16_to_utf8_reversed (the C function) modifies its input, so the XS function of the same name should flatten the input to avoid modifying shared buffers. Brought to you by PERL_DEBUG_READONLY_COW.
Diffstat (limited to 'ext/XS-APItest/APItest.xs')
-rw-r--r--ext/XS-APItest/APItest.xs1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/XS-APItest/APItest.xs b/ext/XS-APItest/APItest.xs
index 1b8ec3f889..f8fc1bffc4 100644
--- a/ext/XS-APItest/APItest.xs
+++ b/ext/XS-APItest/APItest.xs
@@ -2480,6 +2480,7 @@ utf16_to_utf8 (sv, ...)
SV *dest;
I32 got; /* Gah, badly thought out APIs */
CODE:
+ if (ix) (void)SvPV_force_nolen(sv);
source = (U8 *)SvPVbyte(sv, len);
/* Optionally only convert part of the buffer. */
if (items > 1) {