Skip to content

Commit

Permalink
Make conversion of @_ to real array work right after C<shift>
Browse files Browse the repository at this point in the history
  • Loading branch information
Chip Salzenberg authored and Chip Salzenberg committed Mar 6, 1997
1 parent 1b3374c commit 29de640
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions av.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 29de640

Please sign in to comment.