From: Chip Salzenberg Date: Thu, 6 Mar 1997 15:46:34 +0000 (+1200) Subject: Make conversion of @_ to real array work right after C X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=29de640a6fb9462a2ad050b90748e4d2fc5f55b9;p=p5sagit%2Fp5-mst-13.2.git Make conversion of @_ to real array work right after C --- 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)) {