diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-12-17 23:22:31 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-12-17 23:22:31 +0000 |
commit | f4b190e604dfeb3b326a17a85144eca8e832729d (patch) | |
tree | 1bb6a6cb2f606d57d0e5d1f455db20326b9fe040 | |
parent | ff7df920e39ddd3df5ebcc5a06e803af9c883004 (diff) | |
download | perl-f4b190e604dfeb3b326a17a85144eca8e832729d.tar.gz |
Add some paranoia to check that GP accesses aren't being done on the
wrong types of SV.
p4raw-id: //depot/perl@26395
-rw-r--r-- | gv.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -24,7 +24,14 @@ struct gp { #define GvXPVGV(gv) ((XPVGV*)SvANY(gv)) -#define GvGP(gv) (GvXPVGV(gv)->xgv_gp) +#ifdef DEBUGGING +# define GvGP(gv) (*(assert(SvTYPE(gv) == SVt_PVGV || \ + SvTYPE(gv) == SVt_PVLV), \ + &(GvXPVGV(gv)->xgv_gp))) +#else +# define GvGP(gv) (GvXPVGV(gv)->xgv_gp) +#endif + #define GvNAME(gv) (GvXPVGV(gv)->xgv_name) #define GvNAMELEN(gv) (GvXPVGV(gv)->xgv_namelen) #define GvSTASH(gv) (GvXPVGV(gv)->xgv_stash) |