summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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