diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-10-17 16:24:58 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-10-17 16:58:34 -0400 |
commit | d70bfb04654edb2c690488bcaace7a1c7090004d (patch) | |
tree | e9af4f5886e7a1ef94e2290866f1e4e41aaf72a5 /universal.c | |
parent | 80931db166568dce568bdcb2dea79a1dfebf1c15 (diff) | |
download | perl-d70bfb04654edb2c690488bcaace7a1c7090004d.tar.gz |
isa should fall back to checking @UNIVERSAL::ISA in all cases
Diffstat (limited to 'universal.c')
-rw-r--r-- | universal.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/universal.c b/universal.c index 8337e2b4e0..305713fcba 100644 --- a/universal.c +++ b/universal.c @@ -160,15 +160,19 @@ Perl_sv_derived_from_pvn(pTHX_ SV *sv, const char *const name, const STRLEN len, type = sv_reftype(sv,0); if (type && strEQ(type,name)) return TRUE; - stash = SvOBJECT(sv) ? SvSTASH(sv) : NULL; + if (!SvOBJECT(sv)) + return FALSE; + stash = SvSTASH(sv); } else { stash = gv_stashsv(sv, 0); - if (!stash) - stash = gv_stashpvs("UNIVERSAL", 0); } - return stash ? isa_lookup(stash, name, len, flags) : FALSE; + if (stash && isa_lookup(stash, name, len, flags)) + return TRUE; + + stash = gv_stashpvs("UNIVERSAL", 0); + return stash && isa_lookup(stash, name, len, flags); } /* |