0

Fix signed integer overflow in GetRefNumUpper24.

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

Cr-Commit-Position: refs/heads/master@{#303777}
This commit is contained in:
rickyz
2014-11-11 17:33:23 -08:00
committed by Commit bot
parent 32474d8dbd
commit 71cbda10ac

@ -22,8 +22,8 @@ base::StaticAtomicSequenceNumber g_ref_num;
// 8 bits set to 0 for use as flags.
inline uint32 GetRefNumUpper24() {
base::debug::TraceLog* trace_log = base::debug::TraceLog::GetInstance();
int32 pid = trace_log ? trace_log->process_id() : 0;
int32 count = g_ref_num.GetNext();
uint32 pid = trace_log ? trace_log->process_id() : 0;
uint32 count = g_ref_num.GetNext();
// The 24 bit hash is composed of 14 bits of the count and 10 bits of the
// Process ID. With the current trace event buffer cap, the 14-bit count did
// not appear to wrap during a trace. Note that it is not a big deal if