summaryrefslogtreecommitdiff
path: root/ext/mro
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-09-01 14:47:38 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-09-01 14:47:38 -0700
commit3df5c4b513c5e5c2f25d831f556f2a1c5693ce98 (patch)
treedf8369277985791b3c6d12df55c52c32bcb95b1d /ext/mro
parentcbf45e8454c586302a9f324433b3155521872636 (diff)
downloadperl-3df5c4b513c5e5c2f25d831f556f2a1c5693ce98.tar.gz
Teach mro code about null array elements
This is part of ticket #119433. Commit ce0d49f changed AVs to use NULL for nonexistent elements. The mro lookup code was not accounting for that, causing Class::Contract’s tests to crash (and perhaps other modules, too).
Diffstat (limited to 'ext/mro')
-rw-r--r--ext/mro/mro.xs3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/mro/mro.xs b/ext/mro/mro.xs
index 78fa8df0e6..81539b09f6 100644
--- a/ext/mro/mro.xs
+++ b/ext/mro/mro.xs
@@ -80,8 +80,9 @@ S_mro_get_linear_isa_c3(pTHX_ HV* stash, U32 level)
SSize_t items = AvFILLp(isa) + 1;
SV** isa_ptr = AvARRAY(isa);
while(items--) {
- SV* const isa_item = *isa_ptr++;
+ SV* const isa_item = *isa_ptr ? *isa_ptr : &PL_sv_undef;
HV* const isa_item_stash = gv_stashsv(isa_item, 0);
+ isa_ptr++;
if(!isa_item_stash) {
/* if no stash, make a temporary fake MRO
containing just itself */