diff options
-rw-r--r-- | gv.c | 2 | ||||
-rw-r--r-- | gv.h | 1 | ||||
-rw-r--r-- | universal.c | 5 |
3 files changed, 3 insertions, 5 deletions
@@ -890,7 +890,7 @@ S_gv_fetchmeth_internal(pTHX_ HV* stash, SV* meth, const char* name, STRLEN len, } /* Check UNIVERSAL without caching */ - if(level == 0 || level == -1) { + if((level == 0 || level == -1) && !(flags & GV_NOUNIVERSAL)) { candidate = gv_fetchmeth_internal(NULL, meth, name, len, 1, flags &~GV_SUPER); if(candidate) { @@ -245,6 +245,7 @@ Return the CV from the GV. /* Flags for gv_fetchmeth_pvn and gv_autoload_pvn*/ #define GV_SUPER 0x1000 /* SUPER::method */ +#define GV_NOUNIVERSAL 0x2000 /* Skip UNIVERSAL lookup */ /* Flags for gv_autoload_*/ #define GV_AUTOLOAD_ISMETHOD 1 /* autoloading a method? */ diff --git a/universal.c b/universal.c index b839e5151d..5932767bdf 100644 --- a/universal.c +++ b/universal.c @@ -216,10 +216,7 @@ Perl_sv_isa_sv(pTHX_ SV *sv, SV *namesv) if(!SvROK(sv) || !SvOBJECT(SvRV(sv))) return FALSE; - /* TODO: Consider if we want a NOUNIVERSAL flag to skip the - * UNIVERSAL lookup - */ - isagv = gv_fetchmeth_pvn(SvSTASH(SvRV(sv)), "isa", 3, -1, 0); + isagv = gv_fetchmeth_pvn(SvSTASH(SvRV(sv)), "isa", 3, -1, GV_NOUNIVERSAL); if(isagv) { dSP; CV *isacv = isGV(isagv) ? GvCV(isagv) : (CV *)isagv; |