summaryrefslogtreecommitdiff
path: root/cop.h
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-04-23 13:10:56 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-04-23 13:10:56 +0000
commitbe46dfad8454bd0b9f81c4669d39e0b12a423541 (patch)
treeeb21f3deefea81a38b6b6df89517ca1807eae543 /cop.h
parent58fbde930c2396bd190ab93f5f5a9f12649915c4 (diff)
downloadperl-be46dfad8454bd0b9f81c4669d39e0b12a423541.tar.gz
A safer version of CopFILE, by Jarkko
p4raw-id: //depot/perl@31032
Diffstat (limited to 'cop.h')
-rw-r--r--cop.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/cop.h b/cop.h
index c59a7d67a8..72cf84c60b 100644
--- a/cop.h
+++ b/cop.h
@@ -213,7 +213,8 @@ struct cop {
# else
# define CopFILEAVx(c) (GvAV(CopFILEGV(c)))
# endif
-# define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : NULL)
+# define CopFILE(c) (CopFILEGV(c) && GvSV(CopFILEGV(c)) \
+ ? SvPVX(GvSV(CopFILEGV(c))) : NULL)
# define CopSTASH(c) ((c)->cop_stash)
# define CopLABEL(c) ((c)->cop_label)
# define CopSTASH_set(c,hv) ((c)->cop_stash = (hv))