From 7b910cb885e3dd119baf0e7700aa52474f422093 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Tue, 29 Aug 2000 10:17:07 -0700 Subject: [PATCH] Re: [ID 20000829.020] perl -e 'package; print __PACKAGE__' core dumps Message-Id: <200008300017.RAA25382@smtp3.ActiveState.com> p4raw-id: //depot/perl@6909 --- cop.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) \ -- 2.7.4