summaryrefslogtreecommitdiff
path: root/av.c
diff options
context:
space:
mode:
Diffstat (limited to 'av.c')
-rw-r--r--av.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/av.c b/av.c
index 6b4c03d3e7..4a87eaf2b5 100644
--- a/av.c
+++ b/av.c
@@ -15,15 +15,15 @@
#include "EXTERN.h"
#include "perl.h"
-static void av_reify _((AV* av));
-
-static void
+void
av_reify(av)
AV* av;
{
I32 key;
SV* sv;
-
+
+ if (AvREAL(av))
+ return;
key = AvMAX(av) + 1;
while (key > AvFILL(av) + 1)
AvARRAY(av)[--key] = &sv_undef;
@@ -324,6 +324,9 @@ register AV *av;
SvPVX(av) = (char*)AvALLOC(av);
}
AvFILL(av) = -1;
+
+ if (SvRMAGICAL(av))
+ mg_clear((SV*)av);
}
void