summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-06-26 20:21:29 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-06-27 00:51:45 -0700
commitbe6064fd646b3102eae032226820fb886c52b961 (patch)
tree52a4d8aacf35eaf5319a8b1963ad2c57b2469ed5 /pp.c
parent71739502e6eb02644b90372ce6020b03ebc8a428 (diff)
downloadperl-be6064fd646b3102eae032226820fb886c52b961.tar.gz
Null HeVAL and local delete → crash
The XS API allows hash entries to be created with null values. perl itself uses these internally, too. Though they should rarely be seen by Perl code, Perl ops should still be able to handle them without crashing (by croaking). I fixed helem and hslice in 5.16 (commit 746f6409), but missed localised deletions.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pp.c b/pp.c
index 99ff0276c1..82f7105a43 100644
--- a/pp.c
+++ b/pp.c
@@ -4453,6 +4453,7 @@ S_do_delete_local(pTHX)
SvREFCNT_inc_simple_void(sv); /* De-mortalize */
}
if (preeminent) {
+ if (!sv) DIE(aTHX_ PL_no_helem_sv, SVfARG(keysv));
save_helem_flags(hv, keysv, &sv, SAVEf_KEEPOLDELEM);
if (tied) {
*MARK = sv_mortalcopy(sv);
@@ -4539,6 +4540,7 @@ S_do_delete_local(pTHX)
SvREFCNT_inc_simple_void(sv); /* De-mortalize */
}
if (preeminent) {
+ if (!sv) DIE(aTHX_ PL_no_helem_sv, SVfARG(keysv));
save_helem_flags(hv, keysv, &sv, SAVEf_KEEPOLDELEM);
if (tied) {
SV *nsv = sv_mortalcopy(sv);