From: Nicholas Clark Date: Sat, 29 Dec 2007 13:33:38 +0000 (+0000) Subject: Perl_sv_chop() can return early if it's being asked to do nothing. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=15895f8a35fabf511cbf5a8aa01ab74e51cbae24;p=p5sagit%2Fp5-mst-13.2.git Perl_sv_chop() can return early if it's being asked to do nothing. p4raw-id: //depot/perl@32763 --- diff --git a/sv.c b/sv.c index 3e7c3ff..913a5da 100644 --- a/sv.c +++ b/sv.c @@ -4211,6 +4211,10 @@ Perl_sv_chop(pTHX_ register SV *sv, register const char *ptr) if (!ptr || !SvPOKp(sv)) return; delta = ptr - SvPVX_const(sv); + if (!delta) { + /* Nothing to do. */ + return; + } SV_CHECK_THINKFIRST(sv); if (SvTYPE(sv) < SVt_PVIV) sv_upgrade(sv,SVt_PVIV);