From: Rafael Garcia-Suarez Date: Fri, 20 Apr 2007 13:54:26 +0000 (+0000) Subject: A little bit more safe version of HvMROMETA X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9bafe73e6740256c7233414e16e001000131384c;p=p5sagit%2Fp5-mst-13.2.git A little bit more safe version of HvMROMETA p4raw-id: //depot/perl@30994 --- diff --git a/hv.h b/hv.h index 7fb9fc4..a5ea429 100644 --- a/hv.h +++ b/hv.h @@ -266,7 +266,9 @@ C. #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. */