diff options
author | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-03-31 09:50:00 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-03-31 09:50:00 +0200 |
commit | 572558b47236782e60e41bd235c96eae7cbca3db (patch) | |
tree | 8ac9468ea092abb09b436f011a79d57a21e424c8 /pp.c | |
parent | 87b5b7338739cea183f8be8fdb800a2d1173c028 (diff) | |
download | perl-572558b47236782e60e41bd235c96eae7cbca3db.tar.gz |
Avoid a segfault when reversing an empty array in-place.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |