From: Florian Ragwitz Date: Wed, 15 Jul 2009 22:24:36 +0000 (+0200) Subject: Don't fail if a coderef's GV doesn't have a stash. X-Git-Tag: 0.90~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2087a201ef6c5f93fa2f3a0d1a59a399ff689828;p=gitmo%2FClass-MOP.git Don't fail if a coderef's GV doesn't have a stash. --- diff --git a/mop.c b/mop.c index 0fc1be1..dfb178b 100644 --- a/mop.c +++ b/mop.c @@ -96,7 +96,8 @@ mop_get_code_info (SV *coderef, char **pkg, char **name) #ifdef isGV_with_GP if ( isGV_with_GP(CvGV(coderef)) ) { #endif - *pkg = HvNAME( GvSTASH(CvGV(coderef)) ); + GV *gv = CvGV(coderef); + *pkg = HvNAME( GvSTASH(gv) ? GvSTASH(gv) : CvSTASH(coderef) ); *name = GvNAME( CvGV(coderef) ); #ifdef isGV_with_GP } else {