[libcxx-commits] [libcxx] 6ea3344 - [libc++] Fix regex_traits::isctype on big endian platforms (#73200)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Dec 7 06:18:05 PST 2023
Author: W-50243
Date: 2023-12-07T09:18:00-05:00
New Revision: 6ea334456d5851e083b8867f392e00685bc79408
URL: https://github.com/llvm/llvm-project/commit/6ea334456d5851e083b8867f392e00685bc79408
DIFF: https://github.com/llvm/llvm-project/commit/6ea334456d5851e083b8867f392e00685bc79408.diff
LOG: [libc++] Fix regex_traits::isctype on big endian platforms (#73200)
'isctype' fails in arm64-big-endian because the __regex_word involved
in mask operation is not changed based on the platform endianness, while
the character mask does change.
Added:
Modified:
libcxx/include/__locale
Removed:
################################################################################
diff --git a/libcxx/include/__locale b/libcxx/include/__locale
index ab36939f9c14c..6eb892287160e 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -389,7 +389,7 @@ public:
static const mask punct = _ISpunct;
static const mask xdigit = _ISxdigit;
static const mask blank = _ISblank;
-#if defined(__mips__)
+#if defined(__mips__) || (BYTE_ORDER == BIG_ENDIAN)
static const mask __regex_word = static_cast<mask>(_ISbit(15));
#else
static const mask __regex_word = 0x80;
More information about the libcxx-commits
mailing list