Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Unified Diff: base/tracked_objects.cc

Issue 8792005: Suppress unitialized use of memory for random_number_ seed (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/tracked_objects.cc
===================================================================
--- base/tracked_objects.cc (revision 112930)
+++ base/tracked_objects.cc (working copy)
@@ -9,6 +9,7 @@
#include "base/format_macros.h"
#include "base/message_loop.h"
#include "base/stringprintf.h"
+#include "base/third_party/valgrind/memcheck.h"
#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "base/port.h"
@@ -218,6 +219,8 @@
ThreadData::~ThreadData() {}
void ThreadData::PushToHeadOfList() {
+ VALGRIND_MAKE_MEM_DEFINED_IF_ADDRESSABLE(&random_number_,
+ sizeof(random_number_));
// Toss in a hint of randomness (atop the uniniitalized value).
random_number_ += static_cast<int32>(this - static_cast<ThreadData*>(0));
random_number_ ^= (Now() - TrackedTime()).InMilliseconds();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698