From: Brandon L Black Date: Mon, 16 Apr 2007 17:02:08 +0000 (+0000) Subject: 0.01_05, fixed another bug X-Git-Tag: 0.02~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3499e05cfd5432cf9c77a5d8ecc0eec51e162118;p=gitmo%2FClass-C3-XS.git 0.01_05, fixed another bug --- diff --git a/ChangeLog b/ChangeLog index 3534236..1ca1e1f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ Revision history for Perl extension Class::C3::XS +0.01_05 Mon Apr 16, 2007 + Fixed assumption of defined-ness when looking in %Class::C3::MRO + 0.01_04 Mon Apr 16, 2007 Fix threads issue? diff --git a/XS.xs b/XS.xs index c514524..f77cbf9 100644 --- a/XS.xs +++ b/XS.xs @@ -19,7 +19,6 @@ __mro_linear_isa_c3(pTHX_ HV* stash, HV* cache, I32 level) STRLEN stashname_len; assert(stash); - assert(HvAUX(stash)); stashname = HvNAME(stash); stashname_len = strlen(stashname); @@ -292,12 +291,18 @@ __nextcan(pTHX_ SV* self, I32 throw_nomethod) if(cc3_mro) { HE* he_cc3_mro_class = hv_fetch_ent(cc3_mro, linear_sv, 0, 0); if(he_cc3_mro_class) { - HV* cc3_mro_class = (HV*)SvRV(HeVAL(he_cc3_mro_class)); - SV** svp_cc3_mro_class_methods = hv_fetch(cc3_mro_class, "methods", 7, 0); - if(svp_cc3_mro_class_methods) { - HV* cc3_mro_class_methods = (HV*)SvRV(*svp_cc3_mro_class_methods); - if(hv_exists_ent(cc3_mro_class_methods, sub_sv, 0)) - continue; + SV* cc3_mro_class_sv = HeVAL(he_cc3_mro_class); + if(SvROK(cc3_mro_class_sv)) { + HV* cc3_mro_class = (HV*)SvRV(cc3_mro_class_sv); + SV** svp_cc3_mro_class_methods = hv_fetch(cc3_mro_class, "methods", 7, 0); + if(svp_cc3_mro_class_methods) { + SV* cc3_mro_class_methods_sv = *svp_cc3_mro_class_methods; + if(SvROK(cc3_mro_class_methods_sv)) { + HV* cc3_mro_class_methods = (HV*)SvRV(cc3_mro_class_methods_sv); + if(hv_exists_ent(cc3_mro_class_methods, sub_sv, 0)) + continue; + } + } } } } diff --git a/lib/Class/C3/XS.pm b/lib/Class/C3/XS.pm index 71a8aad..ee0a07f 100644 --- a/lib/Class/C3/XS.pm +++ b/lib/Class/C3/XS.pm @@ -1,6 +1,6 @@ package Class::C3::XS; -our $VERSION = '0.01_04'; +our $VERSION = '0.01_05'; =pod