Fix scalar leak in av_unshift
authorChip Salzenberg <chip@perl.com>
Fri, 31 Jan 1997 08:56:47 +0000 (20:56 +1200)
committerChip Salzenberg <chip@atlantic.net>
Tue, 4 Feb 1997 05:47:00 +0000 (17:47 +1200)
av.c

diff --git a/av.c b/av.c
index 554f2619a9ee8c263b3fc9b2bfc28bfe8372c308..67f7880b8f389b62007897141411328f9ca6b70f 100644 (file)
--- 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)