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

Unified Diff: src/disassembler.cc

Issue 1877453002: Fix printf formats (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Handle ptrdiff_t format, which seems to make MSVC barf Created 4 years, 8 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 | « src/crankshaft/lithium-codegen.h ('k') | src/global-handles.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/disassembler.cc
diff --git a/src/disassembler.cc b/src/disassembler.cc
index e7c2c4eb43b3a788cedce04ac7088b29809acd71..d8c7de8beab6cfedde259998e28b60b872bb5058 100644
--- a/src/disassembler.cc
+++ b/src/disassembler.cc
@@ -109,10 +109,9 @@ static int DecodeIt(Isolate* isolate, std::ostream* os,
it->rinfo()->rmode() == RelocInfo::INTERNAL_REFERENCE) {
// raw pointer embedded in code stream, e.g., jump table
byte* ptr = *reinterpret_cast<byte**>(pc);
- SNPrintF(decode_buffer,
- "%08" V8PRIxPTR " jump table entry %4" V8PRIdPTR,
- reinterpret_cast<intptr_t>(ptr),
- ptr - begin);
+ SNPrintF(
+ decode_buffer, "%08" V8PRIxPTR " jump table entry %4" PRIuS,
+ reinterpret_cast<intptr_t>(ptr), static_cast<size_t>(ptr - begin));
pc += sizeof(ptr);
} else {
decode_buffer[0] = '\0';
@@ -147,7 +146,7 @@ static int DecodeIt(Isolate* isolate, std::ostream* os,
}
// Instruction address and instruction offset.
- out.AddFormatted("%p %4d ", prev_pc, prev_pc - begin);
+ out.AddFormatted("%p %4" V8PRIdPTRDIFF " ", prev_pc, prev_pc - begin);
// Instruction.
out.AddFormatted("%s", decode_buffer.start());
@@ -171,9 +170,11 @@ static int DecodeIt(Isolate* isolate, std::ostream* os,
RelocInfo::Mode rmode = relocinfo.rmode();
if (RelocInfo::IsPosition(rmode)) {
if (RelocInfo::IsStatementPosition(rmode)) {
- out.AddFormatted(" ;; debug: statement %d", relocinfo.data());
+ out.AddFormatted(" ;; debug: statement %" V8PRIdPTR,
+ relocinfo.data());
} else {
- out.AddFormatted(" ;; debug: position %d", relocinfo.data());
+ out.AddFormatted(" ;; debug: position %" V8PRIdPTR,
+ relocinfo.data());
}
} else if (rmode == RelocInfo::DEOPT_REASON) {
Deoptimizer::DeoptReason reason =
« no previous file with comments | « src/crankshaft/lithium-codegen.h ('k') | src/global-handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698