diff options
author | Daniel Sanders <daniel.sanders@imgtec.com> | 2016-02-17 13:16:31 +0000 |
---|---|---|
committer | Daniel Sanders <daniel.sanders@imgtec.com> | 2016-02-17 13:16:31 +0000 |
commit | 7e87bc9c67c393c792a0e6bf82e84d9b00b4b169 (patch) | |
tree | 1cc3d19f784b8ba9d94c868442269578d152b162 | |
parent | 62d5d1510348b31224330c9daa7e4d340a486285 (diff) | |
download | external_libcxx-7e87bc9c67c393c792a0e6bf82e84d9b00b4b169.tar.gz external_libcxx-7e87bc9c67c393c792a0e6bf82e84d9b00b4b169.tar.bz2 external_libcxx-7e87bc9c67c393c792a0e6bf82e84d9b00b4b169.zip |
[libcxx] Fix definition of regex_traits::__regex_word on big-endian glibc systems
Summary:
On glibc, the bits used for the various character classes is endian dependant
(see _ISbit() in ctypes.h) but __regex_word does not account for this and uses
a spare bit that isn't spare on big-endian. On big-endian, it overlaps with the
bit for graphic characters which causes '-', '@', etc. to be considered a word
character.
Fixed this by defining the value using _ISbit(15) on MIPS glibc systems. We've
restricted this to MIPS for now to avoid the risk of introducing failures in
other targets.
Fixes PR26476.
Reviewers: hans, mclow.lists
Subscribers: dsanders, cfe-commits
Differential Revision: http://reviews.llvm.org/D17132
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@261088 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/regex | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/regex b/include/regex index f1f3264d3..1139d8fb2 100644 --- a/include/regex +++ b/include/regex @@ -976,7 +976,12 @@ public: typedef locale locale_type; typedef ctype_base::mask char_class_type; +#if defined(__mips__) && defined(__GLIBC__) + static const char_class_type __regex_word = static_cast<char_class_type>(_ISbit(15)); +#else static const char_class_type __regex_word = 0x80; +#endif + private: locale __loc_; const ctype<char_type>* __ct_; |