summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7173950)
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.
warnings; # thank you!
@h{85} = 1 };
pass 'no crash when writing to hash elem with null value via slice';
warnings; # thank you!
@h{85} = 1 };
pass 'no crash when writing to hash elem with null value via slice';
+ eval { delete local $h{86} };
+ pass 'no crash during local deletion of hash elem with null value';
+ eval { delete local @h{87,88} };
+ pass 'no crash during local deletion of hash slice with null values';
}
# [perl #111000] Bug number eleventy-one thousand:
}
# [perl #111000] Bug number eleventy-one thousand:
SvREFCNT_inc_simple_void(sv); /* De-mortalize */
}
if (preeminent) {
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);
save_helem_flags(hv, keysv, &sv, SAVEf_KEEPOLDELEM);
if (tied) {
*MARK = sv_mortalcopy(sv);
SvREFCNT_inc_simple_void(sv); /* De-mortalize */
}
if (preeminent) {
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);
save_helem_flags(hv, keysv, &sv, SAVEf_KEEPOLDELEM);
if (tied) {
SV *nsv = sv_mortalcopy(sv);