summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2016-09-11 21:29:56 -0700
committerFather Chrysostomos <sprout@cpan.org>2016-09-11 21:30:10 -0700
commit92b69f6501b4d7351e09c8b1ddd386aa7e1c9cd1 (patch)
treedf5c4ad56a81c94801ebe37a6adf119bffdb1a6a /pp.c
parent95c0a761e6d0916fd6abd02af5a344be7de9ecdb (diff)
downloadperl-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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pp.c b/pp.c
index 49b6abe6a4..ea49b010c0 100644
--- a/pp.c
+++ b/pp.c
@@ -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;