#endif
#if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
-s |SV*|isa_lookup |HV *stash|const char *name|int len|int level
+s |SV*|isa_lookup |HV *stash|const char *name|HV *name_stash|int len|int level
#endif
#if defined(PERL_IN_LOCALE_C) || defined(PERL_DECL_PROT)
# endif
#endif
#if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
-#define isa_lookup(a,b,c,d) S_isa_lookup(aTHX_ a,b,c,d)
+#define isa_lookup(a,b,c,d,e) S_isa_lookup(aTHX_ a,b,c,d,e)
#endif
#if defined(PERL_IN_LOCALE_C) || defined(PERL_DECL_PROT)
#define stdize_locale(a) S_stdize_locale(aTHX_ a)
#endif
#if defined(PERL_IN_UNIVERSAL_C) || defined(PERL_DECL_PROT)
-STATIC SV* S_isa_lookup(pTHX_ HV *stash, const char *name, int len, int level);
+STATIC SV* S_isa_lookup(pTHX_ HV *stash, const char *name, HV *name_stash, int len, int level);
#endif
#if defined(PERL_IN_LOCALE_C) || defined(PERL_DECL_PROT)
*/
STATIC SV *
-S_isa_lookup(pTHX_ HV *stash, const char *name, int len, int level)
+S_isa_lookup(pTHX_ HV *stash, const char *name, HV* name_stash,
+ int len, int level)
{
AV* av;
GV* gv;
HV* hv = Nullhv;
SV* subgen = Nullsv;
- if (!stash)
- return &PL_sv_undef;
+ /* A stash/class can go by many names (ie. User == main::User), so
+ we compare the stash itself just in case */
+ if (name_stash && (stash == name_stash))
+ return &PL_sv_yes;
if (strEQ(HvNAME(stash), name))
return &PL_sv_yes;
SvPVX(sv), HvNAME(stash));
continue;
}
- if (&PL_sv_yes == isa_lookup(basestash, name, len, level + 1)) {
+ if (&PL_sv_yes == isa_lookup(basestash, name, name_stash,
+ len, level + 1)) {
(void)hv_store(hv,name,len,&PL_sv_yes,0);
return &PL_sv_yes;
}
{
char *type;
HV *stash;
+ HV *name_stash;
stash = Nullhv;
type = Nullch;
stash = gv_stashsv(sv, FALSE);
}
+ name_stash = gv_stashpv(name, FALSE);
+
return (type && strEQ(type,name)) ||
- (stash && isa_lookup(stash, name, strlen(name), 0) == &PL_sv_yes)
+ (stash && isa_lookup(stash, name, name_stash, strlen(name), 0)
+ == &PL_sv_yes)
? TRUE
: FALSE ;
}