Index: runtime/vm/il_printer.cc |
diff --git a/runtime/vm/il_printer.cc b/runtime/vm/il_printer.cc |
index b3410f59672437030e25bc7b112ed3fba2154c82..4a6fe3bd38d397b14803d01fbaf3999ddb7771fe 100644 |
--- a/runtime/vm/il_printer.cc |
+++ b/runtime/vm/il_printer.cc |
@@ -203,7 +203,17 @@ void Value::PrintTo(BufferFormatter* f) const { |
void ConstantInstr::PrintOperandsTo(BufferFormatter* f) const { |
- f->Print("#%s", value().ToCString()); |
+ const char* cstr = value().ToCString(); |
+ const char* new_line = strchr(cstr, '\n'); |
+ if (new_line == NULL) { |
+ f->Print("#%s", cstr); |
+ } else { |
+ const intptr_t pos = new_line - cstr; |
+ char* buffer = Isolate::Current()->current_zone()->Alloc<char>(pos + 1); |
+ strncpy(buffer, cstr, pos); |
+ buffer[pos] = '\0'; |
+ f->Print("#%s\\n...", buffer); |
+ } |
} |