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

Unified Diff: base/trace_event/trace_event_impl.cc

Issue 2043233003: Prevent sign extension for pointer trace values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months 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 | third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_event_impl.cc
diff --git a/base/trace_event/trace_event_impl.cc b/base/trace_event/trace_event_impl.cc
index e2e250ed567ed6385a8ff9072f2a452bd5f0f4be..f469f2f6bcbaa650c7a3263699a22729d742ece1 100644
--- a/base/trace_event/trace_event_impl.cc
+++ b/base/trace_event/trace_event_impl.cc
@@ -261,7 +261,7 @@ void TraceEvent::AppendValueAsJSON(unsigned char type,
// So as not to lose bits from a 64-bit pointer, output as a hex string.
StringAppendF(
out, "\"0x%" PRIx64 "\"",
- static_cast<uint64_t>(reinterpret_cast<intptr_t>(value.as_pointer)));
+ static_cast<uint64_t>(reinterpret_cast<uintptr_t>(value.as_pointer)));
caseq 2016/06/09 16:59:13 can we drop the inner one and do a reinterpret_cas
Kunihiko Sakamoto 2016/06/10 05:19:24 Unfortunately, that doesn't prevent sign extension
break;
case TRACE_VALUE_TYPE_STRING:
case TRACE_VALUE_TYPE_COPY_STRING:
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698