From 29de640a6fb9462a2ad050b90748e4d2fc5f55b9 Mon Sep 17 00:00:00 2001 From: Chip Salzenberg Date: Fri, 7 Mar 1997 03:46:34 +1200 Subject: [PATCH] Make conversion of @_ to real array work right after C --- av.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/av.c b/av.c index c7ca844..9e94805 100644 --- a/av.c +++ b/av.c @@ -33,6 +33,9 @@ AV* av; if (sv != &sv_undef) (void)SvREFCNT_inc(sv); } + key = AvARRAY(av) - AvALLOC(av); + while (key) + AvALLOC(av)[--key] = &sv_undef; AvREAL_on(av); } @@ -197,10 +200,10 @@ SV *val; } if (SvREADONLY(av) && key >= AvFILL(av)) croak(no_modify); - if (key > AvMAX(av)) - av_extend(av,key); if (!AvREAL(av) && AvREIFY(av)) av_reify(av); + if (key > AvMAX(av)) + av_extend(av,key); ary = AvARRAY(av); if (AvFILL(av) < key) { if (!AvREAL(av)) { -- 2.7.4