[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:40:06 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: None (W-50243)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/72992.diff


1 Files Affected:

- (modified) libcxx/include/__locale (+1-1) 


``````````diff
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;

``````````

</details>


https://github.com/llvm/llvm-project/pull/72992


More information about the libcxx-commits mailing list