summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-08-28 18:34:22 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-08-28 22:26:14 -0700
commit031c6d827a20d62a99481765d8e1b1686025aa2b (patch)
treed55bdd0a6a560c8ce05dd07acbfafe9c3e6a5260 /mg.c
parenta600f7e6b3c2fb66bd73b5e0893bfe1a09f26db7 (diff)
downloadperl-031c6d827a20d62a99481765d8e1b1686025aa2b.tar.gz
Make vivify_defelem allow &PL_sv_undef array entries
This is something I failed to change in commit ce0d59f. I don’t know of a way to trigger this in pure-Perl code, hence the use of XS in the test. It did show up in pure-Perl code due to a bug fixed by the previous commit.
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mg.c b/mg.c
index 604fe6bb05..543af8152a 100644
--- a/mg.c
+++ b/mg.c
@@ -2381,7 +2381,7 @@ Perl_vivify_defelem(pTHX_ SV *sv)
LvTARG(sv) = NULL; /* array can't be extended */
else {
SV* const * const svp = av_fetch(av, LvSTARGOFF(sv), TRUE);
- if (!svp || (value = *svp) == &PL_sv_undef)
+ if (!svp || !(value = *svp))
Perl_croak(aTHX_ PL_no_aelem, LvSTARGOFF(sv));
}
}