diff options
author | Chip Salzenberg <chip@perl.com> | 1997-03-07 03:46:34 +1200 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-03-07 04:01:12 +1200 |
commit | 29de640a6fb9462a2ad050b90748e4d2fc5f55b9 (patch) | |
tree | c2679303e1204a8ec9ecb37950f9143e90dd6440 /av.c | |
parent | 1b3374cc62aa03a18646979ac5ddbdd3444d2d14 (diff) | |
download | perl-29de640a6fb9462a2ad050b90748e4d2fc5f55b9.tar.gz |
Make conversion of @_ to real array work right after C<shift>
Diffstat (limited to 'av.c')
-rw-r--r-- | av.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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)) { |