From: Benjamin Sugars Date: Mon, 23 Apr 2001 16:59:33 +0000 (-0400) Subject: Re: Short test case for undef %stash:: crash X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1db89ea5df5f66c75fe36cf6f250c2a633707cee;p=p5sagit%2Fp5-mst-13.2.git Re: Short test case for undef %stash:: crash Message-ID: Changed and moved the perldiag entry. p4raw-id: //depot/perl@9854 --- diff --git a/gv.c b/gv.c index 117667c..eafd982 100644 --- a/gv.c +++ b/gv.c @@ -190,6 +190,8 @@ Perl_gv_fetchmeth(pTHX_ HV *stash, const char *name, STRLEN len, I32 level) if (!stash) return 0; + if (!HvNAME(stash)) + Perl_croak(aTHX_ "Can't use anonymous symbol table for method lookup"); if ((level > 100) || (level < -100)) Perl_croak(aTHX_ "Recursive inheritance detected while looking for method '%s' in package '%s'", name, HvNAME(stash)); diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 98b2580..524c2bd 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -994,6 +994,12 @@ calling sv_upgrade. (F) A value used as either a hard reference or a symbolic reference must be a defined value. This helps to delurk some insidious errors. +=item Can't use anonymous symbol table for method lookup + +(P) The internal routine that does method lookup was handed a symbol +table that doesn't have a name. Symbol tables can become anonymous +for example by undefining stashes: C. + =item Can't use bareword ("%s") as %s ref while "strict refs" in use (F) Only hard references are allowed by "strict refs". Symbolic