From: Gurusamy Sarathy Date: Tue, 29 Aug 2000 17:17:07 +0000 (-0700) Subject: Re: [ID 20000829.020] perl -e 'package; print __PACKAGE__' core dumps X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7b910cb885e3dd119baf0e7700aa52474f422093;p=p5sagit%2Fp5-mst-13.2.git Re: [ID 20000829.020] perl -e 'package; print __PACKAGE__' core dumps Message-Id: <200008300017.RAA25382@smtp3.ActiveState.com> p4raw-id: //depot/perl@6909 --- diff --git a/cop.h b/cop.h index 4fbcf26..5b47884 100644 --- a/cop.h +++ b/cop.h @@ -35,10 +35,10 @@ struct cop { # define CopFILEAV(c) (CopFILE(c) \ ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav) # define CopSTASHPV(c) ((c)->cop_stashpv) -# define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = savepv(pv)) +# define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch)) # define CopSTASH(c) (CopSTASHPV(c) \ ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv) -# define CopSTASH_set(c,hv) CopSTASHPV_set(c, HvNAME(hv)) +# define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch) # define CopSTASH_eq(c,hv) ((hv) \ && (CopSTASHPV(c) == HvNAME(hv) \ || (CopSTASHPV(c) && HvNAME(hv) \