mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 13:25:37 +00:00
Bug 1050185 - Make ThreadStackHelper::FillThreadContext Valgrind-friendly. r=nchen
This commit is contained in:
parent
01e9603ddb
commit
39acca7bb0
@ -22,6 +22,7 @@
|
||||
#include "mozilla/Move.h"
|
||||
#include "mozilla/Scoped.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "mozilla/MemoryChecking.h"
|
||||
|
||||
#ifdef MOZ_THREADSTACKHELPER_NATIVE
|
||||
#include "google_breakpad/processor/call_stack.h"
|
||||
@ -770,6 +771,11 @@ ThreadStackHelper::FillThreadContext(void* aContext)
|
||||
|
||||
#ifndef MOZ_ASAN
|
||||
memcpy(mContextToFill->mStack.get(), reinterpret_cast<void*>(sp), stackSize);
|
||||
// Valgrind doesn't care about the access outside the stack frame, but
|
||||
// the presence of uninitialised values on the stack does cause it to
|
||||
// later report a lot of false errors when Breakpad comes to unwind it.
|
||||
// So mark the extracted data as defined.
|
||||
MOZ_MAKE_MEM_DEFINED(mContextToFill->mStack.get(), stackSize);
|
||||
#else
|
||||
// ASan will flag memcpy for access outside of stack frames,
|
||||
// so roll our own memcpy here.
|
||||
|
Loading…
Reference in New Issue
Block a user