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

Unified Diff: src/string-stream.cc

Issue 10254: Rudimentary analysis (Closed)
Patch Set: Created 12 years, 1 month 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
Index: src/string-stream.cc
diff --git a/src/string-stream.cc b/src/string-stream.cc
index 361fe55842f63c26f3132eab3e881d596a926956..ba7a199c0e13c9dae7bb399773fd05a29542fd02 100644
--- a/src/string-stream.cc
+++ b/src/string-stream.cc
@@ -140,7 +140,17 @@ void StringStream::Add(Vector<const char> format, Vector<FmtElm> elms) {
PrintObject(obj);
break;
}
- case 'i': case 'd': case 'u': case 'x': case 'c': case 'p': {
+ case 'k': {
+ ASSERT_EQ(FmtElm::INT, current.type_);
+ int value = current.data_.u_int_;
+ if (0x20 <= value && value <= 0xFF) {
+ Put(value);
+ } else {
+ Add("\\x%X", value);
+ }
+ break;
+ }
+ case 'i': case 'd': case 'u': case 'x': case 'c': case 'p': case 'X': {
int value = current.data_.u_int_;
EmbeddedVector<char, 24> formatted;
int length = OS::SNPrintF(formatted, temp.start(), value);

Powered by Google App Engine
This is Rietveld 408576698