summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2021-06-06 08:16:34 -0600
committerKarl Williamson <khw@cpan.org>2021-08-07 14:27:01 -0600
commit2d8dd9eb480c087d4be38eccb70dfcbb265548de (patch)
tree84c56b78192123a68a9444bcc739fd1c400f61a6 /handy.h
parent03abef4e914341bd78e7f70808ad55bd1da905cf (diff)
downloadperl-2d8dd9eb480c087d4be38eccb70dfcbb265548de.tar.gz
handy.h: Fix internal macro
I found this reading code. The macro is supposed to check for something not being in the ASCII range, but instead checked that the input is invariant under UTF-8. These concepts evaluate to the same thing on ASCII platforms, but differently on EBCDIC ones. The calls to this macro are such that there isn't a bug that surfaces here, but the code generated is slightly different, and it should be fixed to prevent any future issues.
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/handy.h b/handy.h
index 756c68c041..d9fdd263bc 100644
--- a/handy.h
+++ b/handy.h
@@ -2237,7 +2237,7 @@ END_EXTERN_C
* 'above_latin1' should include its arguments */
#define _generic_utf8_safe_no_upper_latin1(classnum, p, e, above_latin1) \
(__ASSERT_(_utf8_safe_assert(p, e)) \
- (UTF8_IS_INVARIANT(*(p))) \
+ (isASCII(*(p))) \
? _generic_isCC(*(p), classnum) \
: (UTF8_IS_DOWNGRADEABLE_START(*(p))) \
? 0 /* Note that doesn't check validity for latin1 */ \