PR libstdc++/86280 fix undefined left shift on 32-bit targets

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
This commit is contained in:
Jonathan Wakely 2018-06-22 14:05:20 +01:00 committed by Jonathan Wakely
parent 5885a1bd53
commit 0b4bc9a1e8
2 changed files with 6 additions and 1 deletions

View 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]

View 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*);
}