mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-23 00:51:00 +08:00
libstdc++: Make __from_chars_alnum_to_val conversion explicit
The optimizations from commit r12-8175-ga54137c88061c7 introduced a clang integer sanitizer error. Fix this with an explicit static_cast, similar to the fix for PR 96766. libstdc++-v3/ChangeLog: * include/std/charconv (__from_chars_alnum_to_val): Replace implicit conversion from int to unsigned char with explicit cast.
This commit is contained in:
parent
2c044ff123
commit
20ab397224
@ -436,7 +436,7 @@ namespace __detail
|
||||
__from_chars_alnum_to_val(unsigned char __c)
|
||||
{
|
||||
if _GLIBCXX17_CONSTEXPR (_DecOnly)
|
||||
return __c - '0';
|
||||
return static_cast<unsigned char>(__c - '0');
|
||||
else
|
||||
{
|
||||
// This initializer is deliberately made dependent in order to work
|
||||
|
Loading…
x
Reference in New Issue
Block a user