0.01_05, fixed another bug
Brandon L Black [Mon, 16 Apr 2007 17:02:08 +0000 (17:02 +0000)]
ChangeLog
XS.xs
lib/Class/C3/XS.pm

index 3534236..1ca1e1f 100644 (file)
--- 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 (file)
--- 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;
+                            }
+                        }
                     }
                 }
             }
index 71a8aad..ee0a07f 100644 (file)
@@ -1,6 +1,6 @@
 package Class::C3::XS;
 
-our $VERSION = '0.01_04';
+our $VERSION = '0.01_05';
 
 =pod