diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-09-17 23:18:54 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-09-17 23:39:31 -0700 |
commit | 9429039d0141bfd63792bb18dbe602674f9afa8e (patch) | |
tree | 868b086d4af4c1f4243e7e36e6cb806d64bfffc4 /op.h | |
parent | 4b795c961df6ca0753d6819f1daaded9f550a6b7 (diff) | |
download | perl-9429039d0141bfd63792bb18dbe602674f9afa8e.tar.gz |
Only #define IS_(PADGV|CONST) if !PERL_CORE
and give IS_PADGV a simpler definition.
These are not used in the perl core any more and shouldn’t be.
The IS_PADGV definition checked for the IN_PAD flag, which flag never
made much sense (see the prev. commit’s message). Since any GV could
end up with that flag, and since any GV coming near a pad would get
it, it might as well have been turned on for all GVs (except copies).
So just check whether the thingy is a GV.
Diffstat (limited to 'op.h')
-rw-r--r-- | op.h | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -390,18 +390,21 @@ struct loop { #ifdef USE_ITHREADS # define cGVOPx_gv(o) ((GV*)PAD_SVl(cPADOPx(o)->op_padix)) -# define IS_PADGV(v) (v && SvTYPE(v) == SVt_PVGV && isGV_with_GP(v) \ - && GvIN_PAD(v)) -# define IS_PADCONST(v) \ +# ifndef PERL_CORE +# define IS_PADGV(v) (v && isGV(v)) +# define IS_PADCONST(v) \ (v && (SvREADONLY(v) || (SvIsCOW(v) && !SvLEN(v)))) +# endif # define cSVOPx_sv(v) (cSVOPx(v)->op_sv \ ? cSVOPx(v)->op_sv : PAD_SVl((v)->op_targ)) # define cSVOPx_svp(v) (cSVOPx(v)->op_sv \ ? &cSVOPx(v)->op_sv : &PAD_SVl((v)->op_targ)) #else # define cGVOPx_gv(o) ((GV*)cSVOPx(o)->op_sv) -# define IS_PADGV(v) FALSE -# define IS_PADCONST(v) FALSE +# ifndef PERL_CORE +# define IS_PADGV(v) FALSE +# define IS_PADCONST(v) FALSE +# endif # define cSVOPx_sv(v) (cSVOPx(v)->op_sv) # define cSVOPx_svp(v) (&cSVOPx(v)->op_sv) #endif |