From f5b4df4d4bd28d083b2621ed5266a9fb57507d0e Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sun, 3 Sep 2017 11:12:11 -0700 Subject: Add isGV_or_RVCV macro This will be useful for a few code paths that need to treat a sub ref in a stash the same way as a GV. --- sv.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sv.h b/sv.h index a31bd73a52..0fdb8c84bf 100644 --- a/sv.h +++ b/sv.h @@ -2146,6 +2146,10 @@ See also C> and C>. assert (!SvIOKp(sv)); \ (SvFLAGS(sv) &= ~SVpgv_GP); \ } STMT_END +#ifdef PERL_CORE +# define isGV_or_RVCV(kadawp) \ + (isGV(kadawp) || (SvROK(kadawp) && SvTYPE(SvRV(kadawp)) == SVt_PVCV)) +#endif #define isREGEXP(sv) \ (SvTYPE(sv) == SVt_REGEXP \ || (SvFLAGS(sv) & (SVTYPEMASK|SVpgv_GP|SVf_FAKE)) \ -- cgit v1.2.1