MSan does not understand inline asm. This change preinitializes cpuid

results, and disables the use of stos.

Random mmap() addresses conflict with sanitizer memory layout.

R=jkummerow@chromium.org

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

Patch from Evgeniy Stepanov <eugenis@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20400 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4fe93b2d
......@@ -77,10 +77,10 @@ namespace {
void AtomicOps_Internalx86CPUFeaturesInit() {
using v8::internal::AtomicOps_Internalx86CPUFeatures;
uint32_t eax;
uint32_t ebx;
uint32_t ecx;
uint32_t edx;
uint32_t eax = 0;
uint32_t ebx = 0;
uint32_t ecx = 0;
uint32_t edx = 0;
// Get vendor string (issue CPUID with eax = 0)
cpuid(eax, ebx, ecx, edx, 0);
......
......@@ -213,6 +213,11 @@ void* OS::GetRandomMmapAddr() {
// smarter about using mmap address hints.
// See http://code.google.com/p/nativeclient/issues/3341
return NULL;
#endif
#if defined(ADDRESS_SANITIZER) || defined(MEMORY_SANITIZER) || \
defined(THREAD_SANITIZER)
// Dynamic tools do not support custom mmap addresses.
return NULL;
#endif
Isolate* isolate = Isolate::UncheckedCurrent();
// Note that the current isolate isn't set up in a call path via
......
......@@ -215,6 +215,11 @@ inline void MemsetPointer(T** dest, U* value, int counter) {
#undef STOS
#endif
#if defined(MEMORY_SANITIZER)
// MemorySanitizer does not understand inline assembly.
#undef STOS
#endif
#if defined(__GNUC__) && defined(STOS)
asm volatile(
"cld;"
......
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