diff options
author | Father Chrysostomos <sprout@cpan.org> | 2016-09-11 21:29:56 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2016-09-11 21:30:10 -0700 |
commit | 92b69f6501b4d7351e09c8b1ddd386aa7e1c9cd1 (patch) | |
tree | df5c4ad56a81c94801ebe37a6adf119bffdb1a6a /pp.c | |
parent | 95c0a761e6d0916fd6abd02af5a344be7de9ecdb (diff) | |
download | perl-92b69f6501b4d7351e09c8b1ddd386aa7e1c9cd1.tar.gz |
[perl #129164] Crash with splice
This fixes #129166 and #129167 as well.
splice needs to take into account that arrays can hold NULLs and
return &PL_sv_undef in those cases where it would have returned a
NULL element.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -5363,6 +5363,8 @@ PP(pp_splice) for (i = length - 1, dst = &AvARRAY(ary)[offset]; i > 0; i--) SvREFCNT_dec(*dst++); /* free them now */ } + if (!*MARK) + *MARK = &PL_sv_undef; } AvFILLp(ary) += diff; @@ -5459,6 +5461,8 @@ PP(pp_splice) while (length-- > 0) SvREFCNT_dec(tmparyval[length]); } + if (!*MARK) + *MARK = &PL_sv_undef; } else *MARK = &PL_sv_undef; |