perl5.004 hints file (maint and dev paths)
[p5sagit/p5-mst-13.2.git] / av.c
diff --git a/av.c b/av.c
index b4621f3..85bcf0c 100644 (file)
--- a/av.c
+++ b/av.c
@@ -327,6 +327,9 @@ av_clear(register AV *av)
        return;
     /*SUPPRESS 560*/
 
+    if (SvREADONLY(av))
+       croak(no_modify);
+
     /* Give any tie a chance to cleanup first */
     if (SvRMAGICAL(av))
        mg_clear((SV*)av); 
@@ -369,7 +372,6 @@ av_undef(register AV *av)
            SvREFCNT_dec(AvARRAY(av)[--key]);
     }
     Safefree(AvALLOC(av));
-    SvPVX(av) = 0;
     AvALLOC(av) = 0;
     SvPVX(av) = 0;
     AvMAX(av) = AvFILLp(av) = -1;
@@ -479,7 +481,7 @@ av_unshift(register AV *av, register I32 num)
        AvFILLp(av) += i;
        SvPVX(av) = (char*)(AvARRAY(av) - i);
     }
-    if (num) {     
+    if (num) {
        i = AvFILLp(av);
        av_extend(av, i + num);
        AvFILLp(av) += num;