summaryrefslogtreecommitdiff
path: root/inline.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2022-04-21 06:15:41 +0200
committerKarl Williamson <khw@cpan.org>2022-05-27 21:18:10 -0600
commit57e785fdb86b4eb41afd139372aab7841223385f (patch)
treed7561b1007faa9ceb57bc3d0228f1968da2e86c4 /inline.h
parentc5e6a2f4b4dc5540429a0fde0a5b2b01fc167689 (diff)
downloadperl-57e785fdb86b4eb41afd139372aab7841223385f.tar.gz
fixup, use old logic until 5.37 - TO BE SQUASHED
Diffstat (limited to 'inline.h')
-rw-r--r--inline.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/inline.h b/inline.h
index 72fe1d3cd4..d4794aa81a 100644
--- a/inline.h
+++ b/inline.h
@@ -3475,7 +3475,15 @@ Perl_mortal_getenv(const char * str)
PERL_STATIC_INLINE bool
Perl_sv_isbool(pTHX_ const SV *sv)
{
- return SvBoolFlagsOK(sv) && BOOL_INTERNALS_sv_isbool(sv);
+ /* change to the following in 5.37, logically the same but
+ * more efficient and more future proof */
+#if 0
+ return (SvBoolFlagsOK(sv) && BOOL_INTERNALS_sv_isbool(sv));
+#else
+ return SvIOK(sv) && SvPOK(sv) && SvIsCOW_static(sv) &&
+ (SvPVX_const(sv) == PL_Yes || SvPVX_const(sv) == PL_No);
+#endif
+
}
#ifdef USE_ITHREADS