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

Unified Diff: src/ast/prettyprinter.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/ast/prettyprinter.h ('k') | src/base/compiler-specific.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/prettyprinter.cc
diff --git a/src/ast/prettyprinter.cc b/src/ast/prettyprinter.cc
index 2a79049b083a58c13c51b3f9490744aea83bb96c..e845821ebdaedacb1cb42012d315585f67e4f972 100644
--- a/src/ast/prettyprinter.cc
+++ b/src/ast/prettyprinter.cc
@@ -1055,7 +1055,8 @@ void PrettyPrinter::PrintLiteral(Handle<Object> value, bool quote) {
if (object->IsJSFunction()) {
Print("JS-Function");
} else if (object->IsJSArray()) {
- Print("JS-array[%u]", JSArray::cast(object)->length());
+ Print("JS-array[%u]",
+ Smi::cast(JSArray::cast(object)->length())->value());
} else if (object->IsJSObject()) {
Print("JS-Object");
} else {
@@ -1145,7 +1146,7 @@ void AstPrinter::PrintIndented(const char* txt) {
for (int i = 0; i < indent_; i++) {
Print(". ");
}
- Print(txt);
+ Print("%s", txt);
}
@@ -1522,7 +1523,7 @@ void AstPrinter::VisitRegExpLiteral(RegExpLiteral* node) {
if (node->flags() & RegExp::kSticky) buf[i++] = 'y';
buf[i] = '\0';
PrintIndented("FLAGS ");
- Print(buf.start());
+ Print("%s", buf.start());
Print("\n");
}
« no previous file with comments | « src/ast/prettyprinter.h ('k') | src/base/compiler-specific.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698