summaryrefslogtreecommitdiff
path: root/av.c
diff options
context:
space:
mode:
authorChip Salzenberg <chip@perl.com>1997-01-31 20:56:47 +1200
committerChip Salzenberg <chip@atlantic.net>1997-02-04 17:47:00 +1200
commit49beac4814c9f4f107819fdd49700d8c7d84d40b (patch)
tree68f817e0b01bdfc68682793fb3f49b3e347575a5 /av.c
parent0a051f4f5e731bb47ed1e4d5a583f98a0d519501 (diff)
downloadperl-49beac4814c9f4f107819fdd49700d8c7d84d40b.tar.gz
Fix scalar leak in av_unshift
Diffstat (limited to 'av.c')
-rw-r--r--av.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/av.c b/av.c
index 554f2619a9..67f7880b8f 100644
--- a/av.c
+++ b/av.c
@@ -199,9 +199,8 @@ SV *val;
croak(no_modify);
if (key > AvMAX(av))
av_extend(av,key);
- if (AvREIFY(av))
+ if (!AvREAL(av) && AvREIFY(av))
av_reify(av);
-
ary = AvARRAY(av);
if (AvFILL(av) < key) {
if (!AvREAL(av)) {
@@ -385,12 +384,8 @@ register I32 num;
return;
if (SvREADONLY(av))
croak(no_modify);
- if (!AvREAL(av)) {
- if (AvREIFY(av))
- av_reify(av);
- else
- croak("Can't unshift");
- }
+ if (!AvREAL(av) && AvREIFY(av))
+ av_reify(av);
i = AvARRAY(av) - AvALLOC(av);
if (i) {
if (i > num)