Commit 00f38351 authored by earthdok@chromium.org's avatar earthdok@chromium.org

MemorySanitizer: remove msan_unpoison_string() from zygote_main_linux.cc

This function is now available from the sanitizer runtime. No need to keep our
own implementation around.

BUG=123263
TBR=jln@chromium.org
NOTRY=true
TEST=compile

Review URL: https://codereview.chromium.org/289473002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270127 0039d316-1c4b-4281-b951-d872f2087c98
parent 338416c0
......@@ -181,17 +181,6 @@ static void InitLibcLocaltimeFunctions() {
g_libc_localtime64_r = g_libc_localtime_r;
}
#if defined(MEMORY_SANITIZER)
void msan_unpoison_string(const char *s) {
if (!s) return;
// Can't call strlen() on an uninitialized string. Instead, unpoison byte by
// byte until the string is over.
do {
__msan_unpoison(s, sizeof(*s));
} while(*(s++));
}
#endif
// Define localtime_override() function with asm name "localtime", so that all
// references to localtime() will resolve to this function. Notice that we need
// to set visibility attribute to "default" to export the symbol, as it is set
......@@ -213,7 +202,7 @@ struct tm* localtime_override(const time_t* timep) {
struct tm* res = g_libc_localtime(timep);
#if defined(MEMORY_SANITIZER)
if (res) __msan_unpoison(res, sizeof(*res));
if (res->tm_zone) msan_unpoison_string(res->tm_zone);
if (res->tm_zone) __msan_unpoison_string(res->tm_zone);
#endif
return res;
}
......@@ -237,7 +226,7 @@ struct tm* localtime64_override(const time_t* timep) {
struct tm* res = g_libc_localtime64(timep);
#if defined(MEMORY_SANITIZER)
if (res) __msan_unpoison(res, sizeof(*res));
if (res->tm_zone) msan_unpoison_string(res->tm_zone);
if (res->tm_zone) __msan_unpoison_string(res->tm_zone);
#endif
return res;
}
......@@ -258,7 +247,7 @@ struct tm* localtime_r_override(const time_t* timep, struct tm* result) {
struct tm* res = g_libc_localtime_r(timep, result);
#if defined(MEMORY_SANITIZER)
if (res) __msan_unpoison(res, sizeof(*res));
if (res->tm_zone) msan_unpoison_string(res->tm_zone);
if (res->tm_zone) __msan_unpoison_string(res->tm_zone);
#endif
return res;
}
......@@ -279,7 +268,7 @@ struct tm* localtime64_r_override(const time_t* timep, struct tm* result) {
struct tm* res = g_libc_localtime64_r(timep, result);
#if defined(MEMORY_SANITIZER)
if (res) __msan_unpoison(res, sizeof(*res));
if (res->tm_zone) msan_unpoison_string(res->tm_zone);
if (res->tm_zone) __msan_unpoison_string(res->tm_zone);
#endif
return res;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment