[Moose-commits] r7582 - Class-MOP/trunk

autarch at code2.0beta.co.uk autarch at code2.0beta.co.uk
Sun Feb 8 16:41:11 GMT 2009


Author: autarch
Date: 2009-02-08 08:41:11 -0800 (Sun, 08 Feb 2009)
New Revision: 7582

Modified:
   Class-MOP/trunk/MOP.xs
Log:
Make the XS version of is_class_loaded smarter about handling corner
cases where a VERSION entry in the stash exists but we haven't
_really_ loaded the class yet.

Modified: Class-MOP/trunk/MOP.xs
===================================================================
--- Class-MOP/trunk/MOP.xs	2009-02-08 15:10:38 UTC (rev 7581)
+++ Class-MOP/trunk/MOP.xs	2009-02-08 16:41:11 UTC (rev 7582)
@@ -364,8 +364,18 @@
 
         if (hv_exists_ent (stash, key_VERSION, hash_VERSION)) {
             HE *version = hv_fetch_ent(stash, key_VERSION, 0, hash_VERSION);
-            if (version && HeVAL(version) && GvSV(HeVAL(version))) {
-                XSRETURN_YES;
+            SV *version_sv;
+            if (version && HeVAL(version) && (version_sv = GvSV(HeVAL(version)))) {
+                if (SvROK(version_sv)) {
+                    SV *version_sv_ref = SvRV(version_sv);
+
+                    if (SvOK(version_sv_ref)) {
+                        XSRETURN_YES;
+                    }
+                }
+                else if (SvOK(version_sv)) {
+                    XSRETURN_YES;
+                }
             }
         }
 




More information about the Moose-commits mailing list