This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
738f9db
)
Add isGV_or_RVCV macro
author
Father Chrysostomos
<sprout@cpan.org>
Sun, 3 Sep 2017 18:12:11 +0000
(11:12 -0700)
committer
Father Chrysostomos
<sprout@cpan.org>
Sun, 8 Oct 2017 20:02:03 +0000
(13:02 -0700)
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
patch
|
blob
|
blame
|
history
diff --git
a/sv.h
b/sv.h
index
a31bd73
..
0fdb8c8
100644
(file)
--- a/
sv.h
+++ b/
sv.h
@@
-2146,6
+2146,10
@@
See also C<L</PL_sv_yes>> and C<L</PL_sv_no>>.
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)) \