summaryrefslogtreecommitdiffstats
path: root/libcxx/src
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2014-11-14 22:23:57 +0000
committerEric Fiselier <eric@efcs.ca>2014-11-14 22:23:57 +0000
commitd6bd7bf6ba4f71338f2cf323624078cdbbb6b374 (patch)
treec63176030ced8b20780b46d04cc2aec8c018257a /libcxx/src
parent0425c7c72615a69a0182dabd23b7caf16a709690 (diff)
downloadbcm5719-llvm-d6bd7bf6ba4f71338f2cf323624078cdbbb6b374.tar.gz
bcm5719-llvm-d6bd7bf6ba4f71338f2cf323624078cdbbb6b374.zip
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
Diffstat (limited to 'libcxx/src')
-rw-r--r--libcxx/src/string.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/src/string.cpp b/libcxx/src/string.cpp
index fdaad292734..febc5320997 100644
--- a/libcxx/src/string.cpp
+++ b/libcxx/src/string.cpp
@@ -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;
OpenPOWER on IntegriCloud