diff options
author | Gisle Aas <gisle@aas.no> | 1998-06-24 17:11:35 +0200 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-06-28 19:23:40 +0000 |
commit | 48cdf507c2336254e1128c94e7b4ba57b106d9a9 (patch) | |
tree | 3a0b6379b40ab8efdf0c334e38849a4b809deb6e /pp.c | |
parent | 62f468fcc5ab60fb5a3476c4f51edf76066f5db7 (diff) | |
download | perl-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.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 */ |