[ 15462]
Avoid core-dump in Encode with PERLIO=mmap
p4raw-link: @15462 on //depot/perlio:
b4d9096427023cc00e82f9ecbc4205dfe7395a78
p4raw-id: //depot/perl@15466
p4raw-integrated: from //depot/perlio@15465 'copy in'
ext/Encode/Encode.xs (@15462..)
if (check) {
sdone = SvCUR(src) - (slen+sdone);
if (sdone) {
+#if 1
+ /* FIXME: A Move() is dangerous - PV could be mmap'ed readonly
+ SvOOK would be ideal - but sv_backoff does not understand SvLEN == 0
+ type SVs and sv_clear() calls it ...
+ */
+ sv_setpvn(src,s+slen,sdone);
+#else
Move(s + slen, SvPVX(src), sdone , U8);
+#endif
}
SvCUR_set(src, sdone);
}