[libcxx-commits] [libcxx] [FIX] Fix the function 'isctype' failed in arm64-be (PR #72992)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 21 05:39:35 PST 2023


https://github.com/W-50243 created https://github.com/llvm/llvm-project/pull/72992

The function 'isctype' failes in arm64-be while succeeds in arm64-le 。This is because the function does not judge the big endian and small endian modes to distinguish the value of __regex_word.

>From 499c569ecc6c521467250bbe27e040ecdd08405a Mon Sep 17 00:00:00 2001
From: W-50243 <wanghao636 at huawei.com>
Date: Tue, 21 Nov 2023 21:22:47 +0800
Subject: [PATCH] [FIX] Fix the function 'isctype' failed in arm64-be

---
 libcxx/include/__locale | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcxx/include/__locale b/libcxx/include/__locale
index b1502dd71edadf6..4b672745e8378f3 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -372,7 +372,7 @@ public:
 #else
     static const mask __regex_word = 1<<10;
 #endif // defined(__BIONIC__)
-#elif defined(__GLIBC__)
+#elif defined(__GLIBC__) || defined(__BIG_ENDIAN__)
     typedef unsigned short mask;
     static const mask space  = _ISspace;
     static const mask print  = _ISprint;



More information about the libcxx-commits mailing list