summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorGisle Aas <gisle@aas.no>1998-06-24 17:11:35 +0200
committerGurusamy Sarathy <gsar@cpan.org>1998-06-28 19:23:40 +0000
commit48cdf507c2336254e1128c94e7b4ba57b106d9a9 (patch)
tree3a0b6379b40ab8efdf0c334e38849a4b809deb6e /pp.c
parent62f468fcc5ab60fb5a3476c4f51edf76066f5db7 (diff)
downloadperl-48cdf507c2336254e1128c94e7b4ba57b106d9a9.tar.gz
Negative LENGTH argument to splice
Message-ID: <m3g1gvc5bs.fsf@furu.g.aas.no> p4raw-id: //depot/perl@1237
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index a0949a1def..6cc98fd617 100644
--- a/pp.c
+++ b/pp.c
@@ -2589,8 +2589,11 @@ PP(pp_splice)
DIE(no_aelem, i);
if (++MARK < SP) {
length = SvIVx(*MARK++);
- if (length < 0)
- length = 0;
+ if (length < 0) {
+ length += AvFILLp(ary) - offset + 1;
+ if (length < 0)
+ length = 0;
+ }
}
else
length = AvMAX(ary) + 1; /* close enough to infinity */