From: Nicholas Clark Date: Fri, 2 Mar 2007 13:23:22 +0000 (+0000) Subject: Don't crash if the symbol table entry for ISA isn't a typeglob. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=06be3b4087230d77129ccda5ba56e0397c241c48;p=p5sagit%2Fp5-mst-13.2.git Don't crash if the symbol table entry for ISA isn't a typeglob. p4raw-id: //depot/perl@30442 --- diff --git a/gv.c b/gv.c index e03521e..aac25b6 100644 --- a/gv.c +++ b/gv.c @@ -368,7 +368,7 @@ Perl_gv_fetchmeth(pTHX_ HV *stash, const char *name, STRLEN len, I32 level) } gvp = (GV**)hv_fetchs(stash, "ISA", FALSE); - av = (gvp && (gv = *gvp) && gv != (GV*)&PL_sv_undef) ? GvAV(gv) : NULL; + av = (gvp && (gv = *gvp) && isGV_with_GP(gv)) ? GvAV(gv) : NULL; /* create and re-create @.*::SUPER::ISA on demand */ if (!av || !SvMAGIC(av)) { diff --git a/t/op/gv.t b/t/op/gv.t index d243fb7..4475912 100755 --- a/t/op/gv.t +++ b/t/op/gv.t @@ -12,7 +12,7 @@ BEGIN { use warnings; require './test.pl'; -plan( tests => 154 ); +plan( tests => 155 ); # type coersion on assignment $foo = 'foo'; @@ -453,6 +453,12 @@ foreach my $value ([1,2,3], {1=>2}, *STDOUT{IO}, \&ok, *STDOUT{FORMAT}) { "PERL_DONT_CREATE_GVSV shouldn't affect thingy syntax under strict"); } +{ + # Bug reported by broquaint on IRC + *slosh::{HASH}->{ISA}=[]; + slosh->import; + pass("gv_fetchmeth coped with the unexpected"); +} __END__ Perl Rules