From: Nicholas Clark Date: Sun, 16 Apr 2006 10:37:46 +0000 (+0000) Subject: In Perl_sv_usepvn(), force a move under DEBUGGING to shake out caller X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=69d25b4f32e8b88ba21011f0df2af3779b14626d;p=p5sagit%2Fp5-mst-13.2.git In Perl_sv_usepvn(), force a move under DEBUGGING to shake out caller bugs. p4raw-id: //depot/perl@27839 --- diff --git a/sv.c b/sv.c index 8171c7f..3c8fa77 100644 --- a/sv.c +++ b/sv.c @@ -3915,7 +3915,18 @@ Perl_sv_usepvn(pTHX_ register SV *sv, register char *ptr, register STRLEN len) SvPV_free(sv); allocate = PERL_STRLEN_ROUNDUP(len + 1); +#ifdef DEBUGGING + { + /* Force a move to shake out bugs in callers. */ + char *new_ptr = safemalloc(allocate); + Copy(ptr, new_ptr, len, char); + PoisonFree(ptr,len,char); + Safefree(ptr); + ptr = new_ptr; + } +#else ptr = saferealloc (ptr, allocate); +#endif SvPV_set(sv, ptr); SvCUR_set(sv, len); SvLEN_set(sv, allocate);