From: Rafael Garcia-Suarez Date: Wed, 31 Mar 2010 07:50:00 +0000 (+0200) Subject: Avoid a segfault when reversing an empty array in-place. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=572558b47236782e60e41bd235c96eae7cbca3db;p=p5sagit%2Fp5-mst-13.2.git Avoid a segfault when reversing an empty array in-place. --- diff --git a/pp.c b/pp.c index 5876cfd..daa63af 100644 --- a/pp.c +++ b/pp.c @@ -5420,7 +5420,7 @@ PP(pp_reverse) SV **begin = AvARRAY(av); SV **end = begin + AvFILLp(av); - while (begin < end) { + while (begin && begin < end) { register SV * const tmp = *begin; *begin++ = *end; *end-- = tmp;