From: Florian Ragwitz Date: Sat, 14 Feb 2009 02:59:10 +0000 (+0000) Subject: Don't call GvCV on something that's not a GV. X-Git-Tag: 0.77~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5f715d98beb92eba35f060d4fd33b4e1134daa5c;p=gitmo%2FClass-MOP.git Don't call GvCV on something that's not a GV. --- diff --git a/MOP.xs b/MOP.xs index 71e2c7d..4fbf38f 100644 --- a/MOP.xs +++ b/MOP.xs @@ -354,7 +354,7 @@ is_class_loaded(klass=&PL_sv_undef) HV *stash; char *key; I32 keylen; - GV *gv; + SV *gv; PPCODE: if (!SvPOK(klass) || !SvCUR(klass)) { XSRETURN_NO; @@ -390,7 +390,7 @@ is_class_loaded(klass=&PL_sv_undef) } (void)hv_iterinit(stash); - while ((gv = (GV *)hv_iternextsv(stash, &key, &keylen))) { + while ((gv = hv_iternextsv(stash, &key, &keylen))) { if (keylen <= 0) { continue; } @@ -399,7 +399,7 @@ is_class_loaded(klass=&PL_sv_undef) continue; } - if (GvCV(gv)) { + if (!isGV(gv) || GvCV(gv)) { XSRETURN_YES; } }