diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2004-03-31 20:33:52 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2004-03-31 20:33:52 +0000 |
commit | a62140726edcf5b33bdd8fed9a26ab90d77ec144 (patch) | |
tree | 8e73b0fa645f1e1832f44a05af435779b7f50c73 /av.c | |
parent | 7be0dac30b98062294521bd59732f1029a6de1ce (diff) | |
download | perl-a62140726edcf5b33bdd8fed9a26ab90d77ec144.tar.gz |
[perl #28032] delete $_[0] + (\$) prototype = bad free
av_delete() didn't reify. I also updated its description
p4raw-id: //depot/perl@22624
Diffstat (limited to 'av.c')
-rw-r--r-- | av.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -782,7 +782,8 @@ Perl_av_fill(pTHX_ register AV *av, I32 fill) =for apidoc av_delete Deletes the element indexed by C<key> from the array. Returns the -deleted element. C<flags> is currently ignored. +deleted element. If C<flags> equals C<G_DISCARD>, the element is freed +and null is returned. =cut */ @@ -840,6 +841,8 @@ Perl_av_delete(pTHX_ AV *av, I32 key, I32 flags) if (key > AvFILLp(av)) return Nullsv; else { + if (!AvREAL(av) && AvREIFY(av)) + av_reify(av); sv = AvARRAY(av)[key]; if (key == AvFILLp(av)) { AvARRAY(av)[key] = &PL_sv_undef; |