summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-04-20 13:54:26 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-04-20 13:54:26 +0000
commit9bafe73e6740256c7233414e16e001000131384c (patch)
treea62e78fc139d728107856bd896bf098f7d7a3562 /hv.h
parent5f5ae4a7c00fa8527fbc1cf66da85ee1690fc1a7 (diff)
downloadperl-9bafe73e6740256c7233414e16e001000131384c.tar.gz
A little bit more safe version of HvMROMETA
p4raw-id: //depot/perl@30994
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/hv.h b/hv.h
index 7fb9fc4099..a5ea429b78 100644
--- a/hv.h
+++ b/hv.h
@@ -266,7 +266,9 @@ C<SV*>.
#define HvRITER_get(hv) (SvOOK(hv) ? HvAUX(hv)->xhv_riter : -1)
#define HvEITER_get(hv) (SvOOK(hv) ? HvAUX(hv)->xhv_eiter : 0)
#define HvNAME(hv) HvNAME_get(hv)
-#define HvMROMETA(hv) (HvAUX(hv)->xhv_mro_meta ? HvAUX(hv)->xhv_mro_meta : mro_meta_init(hv))
+#define HvMROMETA(hv) (SvOOK(hv) \
+ ? (HvAUX(hv)->xhv_mro_meta ? HvAUX(hv)->xhv_mro_meta : mro_meta_init(hv)) \
+ : NULL)
/* FIXME - all of these should use a UTF8 aware API, which should also involve
getting the length. */
/* This macro may go away without notice. */