forked from OSchip/llvm-project
Initialize pointer in string conversion helpers to prevent MSAN diagnostic.
Since the initialization of the pointer happens across the libc library boundry MSAN will not know the pointer was initialized. This fixes MSAN failures in test/strings/string.conversions. llvm-svn: 222052
This commit is contained in:
parent
0425c7c726
commit
d6bd7bf6ba
|
@ -63,7 +63,7 @@ inline
|
|||
V
|
||||
as_integer_helper(const string& func, const S& str, size_t* idx, int base, F f)
|
||||
{
|
||||
typename S::value_type* ptr;
|
||||
typename S::value_type* ptr = nullptr;
|
||||
const typename S::value_type* const p = str.c_str();
|
||||
typename remove_reference<decltype(errno)>::type errno_save = errno;
|
||||
errno = 0;
|
||||
|
@ -180,7 +180,7 @@ inline
|
|||
V
|
||||
as_float_helper(const string& func, const S& str, size_t* idx, F f )
|
||||
{
|
||||
typename S::value_type* ptr;
|
||||
typename S::value_type* ptr = nullptr;
|
||||
const typename S::value_type* const p = str.c_str();
|
||||
typename remove_reference<decltype(errno)>::type errno_save = errno;
|
||||
errno = 0;
|
||||
|
|
Loading…
Reference in New Issue