diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-03-02 02:27:05 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-03-02 02:27:05 +0000 |
commit | 8cbc2e3b35a2d1fc6313ced2b006c574c892f00d (patch) | |
tree | 60dfbbee32eadadf4b328920f52e550e60802eff /pp.c | |
parent | d19c0e07ebd08db71e942d0ac908b6a0cb59810f (diff) | |
download | perl-8cbc2e3b35a2d1fc6313ced2b006c574c892f00d.tar.gz |
PATCH: "splice() offset past end of array" warning. (take 2)
From: Schuyler Erle <schuyler@oreilly.com>
Date: Fri, 01 Mar 2002 14:22:19 -0800
Message-ID: <3C7FFF1B.E74979B1@oreilly.com>
Subject: Re: PATCH: "splice() offset past end of array" warning.
From: Mark-Jason Dominus <mjd@plover.com>
Date: Fri, 01 Mar 2002 17:19:49 -0500
Message-ID: <20020301221949.7610.qmail@plover.com>
p4raw-id: //depot/perl@14939
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -3926,8 +3926,11 @@ PP(pp_splice) offset = 0; length = AvMAX(ary) + 1; } - if (offset > AvFILLp(ary) + 1) + if (offset > AvFILLp(ary) + 1) { + if (ckWARN(WARN_MISC)) + Perl_warner(aTHX_ WARN_MISC, "splice() offset past end of array" ); offset = AvFILLp(ary) + 1; + } after = AvFILLp(ary) + 1 - (offset + length); if (after < 0) { /* not that much array */ length += after; /* offset+length now in array */ |