diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-09-22 12:06:45 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-09-22 17:10:43 -0700 |
commit | 39984de3a8e9c16c0fee320a579cb465d0ce7314 (patch) | |
tree | 6de01c6f9ff381e7c3ade269ed1efbd1f685ab6e /pp_hot.c | |
parent | 9c744f4f4d7678009336db8141276918751b7c52 (diff) | |
download | perl-39984de3a8e9c16c0fee320a579cb465d0ce7314.tar.gz |
Stop array assignment from leaking on croak
This made a to-do test in sort.t pass, but adventitiously, so I modi-
fied it to fail again.
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -982,15 +982,14 @@ PP(pp_aassign) while (relem <= lastrelem) { /* gobble up all the rest */ SV **didstore; assert(*relem); - sv = newSV(0); + sv = sv_newmortal(); sv_setsv(sv, *relem); *(relem++) = sv; didstore = av_store(ary,i++,sv); + if (didstore) SvREFCNT_inc_simple_void_NN(sv); if (magic) { if (SvSMAGICAL(sv)) mg_set(sv); - if (!didstore) - sv_2mortal(sv); } TAINT_NOT; } |