PR libstdc++/86280 fix undefined left shift on 32-bit targets
authorJonathan Wakely <jwakely@redhat.com>
Fri, 22 Jun 2018 13:05:20 +0000 (14:05 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 22 Jun 2018 13:05:20 +0000 (14:05 +0100)
PR libstdc++/86280
* include/experimental/memory_resource
(__resource_adaptor_common::_AlignMgr::_M_token_size): Use type large
enough for result of left shift.

From-SVN: r261888

libstdc++-v3/ChangeLog
libstdc++-v3/include/experimental/memory_resource

index 1c4e467bbbe97b0957da06131de777f8bfbee77d..cf644b45b1799a86f247da4e305e59f77513f003 100644 (file)
@@ -1,5 +1,10 @@
 2018-06-22  Jonathan Wakely  <jwakely@redhat.com>
 
+       PR libstdc++/86280
+       * include/experimental/memory_resource
+       (__resource_adaptor_common::_AlignMgr::_M_token_size): Use type large
+       enough for result of left shift.
+
        PR libstdc++/86138
        * include/bits/basic_string.tcc:
        [__cplusplus > 201402 && !_GLIBCXX_USE_CXX11_ABI]
index 8f5a8df14c95e9a1a2ac3ae4c087cf1a74f48b73..1965fdcfe73be793bd01b5ff0b6e627c623fc8c9 100644 (file)
@@ -326,7 +326,7 @@ namespace pmr {
          return 1;
        if (_M_align <= (1ul << (sizeof(short) * __CHAR_BIT__)))
          return sizeof(short);
-       if (_M_align <= (1ul << (sizeof(int) * __CHAR_BIT__)))
+       if (_M_align <= (1ull << (sizeof(int) * __CHAR_BIT__)))
          return sizeof(int);
        return sizeof(char*);
       }