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

Unified Diff: runtime/vm/deopt_instructions.cc

Issue 10869063: Add attributions so printf like functions can have their arguments checked. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebased Created 8 years, 3 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 | « runtime/vm/debugger_api_impl_test.cc ('k') | runtime/vm/disassembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/deopt_instructions.cc
diff --git a/runtime/vm/deopt_instructions.cc b/runtime/vm/deopt_instructions.cc
index d7ad5af870b956cedf95cee39173342800a09588..2222143a3b36094ca1c6d72cb51bb4c413ebda8b 100644
--- a/runtime/vm/deopt_instructions.cc
+++ b/runtime/vm/deopt_instructions.cc
@@ -55,9 +55,10 @@ class DeoptStackSlotInstr : public DeoptInstr {
virtual DeoptInstr::Kind kind() const { return kCopyStackSlot; }
virtual const char* ToCString() const {
- intptr_t len = OS::SNPrint(NULL, 0, "s%d", stack_slot_index_);
+ const char* format = "s%"Pd"";
+ intptr_t len = OS::SNPrint(NULL, 0, format, stack_slot_index_);
char* chars = Isolate::Current()->current_zone()->Alloc<char>(len + 1);
- OS::SNPrint(chars, len + 1, "s%d", stack_slot_index_);
+ OS::SNPrint(chars, len + 1, format, stack_slot_index_);
return chars;
}
@@ -87,9 +88,10 @@ class DeoptDoubleStackSlotInstr : public DeoptInstr {
virtual DeoptInstr::Kind kind() const { return kCopyDoubleStackSlot; }
virtual const char* ToCString() const {
- intptr_t len = OS::SNPrint(NULL, 0, "ds%d", stack_slot_index_);
+ const char* format = "ds%"Pd"";
+ intptr_t len = OS::SNPrint(NULL, 0, format, stack_slot_index_);
char* chars = Isolate::Current()->current_zone()->Alloc<char>(len + 1);
- OS::SNPrint(chars, len + 1, "ds%d", stack_slot_index_);
+ OS::SNPrint(chars, len + 1, format, stack_slot_index_);
return chars;
}
@@ -125,9 +127,10 @@ class DeoptRetAddrAfterInstr : public DeoptInstr {
virtual DeoptInstr::Kind kind() const { return kSetRetAfterAddress; }
virtual const char* ToCString() const {
- intptr_t len = OS::SNPrint(NULL, 0, "ret aft oti:%d", object_table_index_);
+ const char* format = "ret aft oti:%"Pd"";
+ intptr_t len = OS::SNPrint(NULL, 0, format, object_table_index_);
char* chars = Isolate::Current()->current_zone()->Alloc<char>(len + 1);
- OS::SNPrint(chars, len + 1, "ret aft oti:%d", object_table_index_);
+ OS::SNPrint(chars, len + 1, format, object_table_index_);
return chars;
}
@@ -165,9 +168,10 @@ class DeoptRetAddrBeforeInstr : public DeoptInstr {
virtual DeoptInstr::Kind kind() const { return kSetRetBeforeAddress; }
virtual const char* ToCString() const {
- intptr_t len = OS::SNPrint(NULL, 0, "ret bef oti:%d", object_table_index_);
+ const char* format = "ret bef oti:%"Pd"";
+ intptr_t len = OS::SNPrint(NULL, 0, format, object_table_index_);
char* chars = Isolate::Current()->current_zone()->Alloc<char>(len + 1);
- OS::SNPrint(chars, len + 1, "ret bef oti:%d", object_table_index_);
+ OS::SNPrint(chars, len + 1, format, object_table_index_);
return chars;
}
@@ -203,9 +207,10 @@ class DeoptConstantInstr : public DeoptInstr {
virtual DeoptInstr::Kind kind() const { return kCopyConstant; }
virtual const char* ToCString() const {
- intptr_t len = OS::SNPrint(NULL, 0, "const oti:%d", object_table_index_);
+ const char* format = "const oti:%"Pd"";
+ intptr_t len = OS::SNPrint(NULL, 0, format, object_table_index_);
char* chars = Isolate::Current()->current_zone()->Alloc<char>(len + 1);
- OS::SNPrint(chars, len + 1, "const oti:%d", object_table_index_);
+ OS::SNPrint(chars, len + 1, format, object_table_index_);
return chars;
}
@@ -291,9 +296,10 @@ class DeoptPcMarkerInstr : public DeoptInstr {
virtual DeoptInstr::Kind kind() const { return kSetPcMarker; }
virtual const char* ToCString() const {
- intptr_t len = OS::SNPrint(NULL, 0, "pcmark oti:%d", object_table_index_);
+ const char* format = "pcmark oti:%"Pd"";
+ intptr_t len = OS::SNPrint(NULL, 0, format, object_table_index_);
char* chars = Isolate::Current()->current_zone()->Alloc<char>(len + 1);
- OS::SNPrint(chars, len + 1, "pcmark oti:%d", object_table_index_);
+ OS::SNPrint(chars, len + 1, format, object_table_index_);
return chars;
}
« no previous file with comments | « runtime/vm/debugger_api_impl_test.cc ('k') | runtime/vm/disassembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698