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

Unified Diff: runtime/vm/object.cc

Issue 266783002: Save the entry context for a function that has captured loop variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 6311d13349c211cf7de49e87b14191f21382b2db..82c257303519a129f81a4d38511624a49cbfbcf5 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -10309,6 +10309,9 @@ static int PrintVarInfo(char* buffer, int len,
const char* LocalVarDescriptors::ToCString() const {
+ if (IsNull()) {
+ return "LocalVarDescriptors(NULL)";
+ }
intptr_t len = 1; // Trailing '\0'.
String& var_name = String::Handle();
for (intptr_t i = 0; i < Length(); i++) {
@@ -10320,7 +10323,8 @@ const char* LocalVarDescriptors::ToCString() const {
GetInfo(i, &info);
len += PrintVarInfo(NULL, 0, i, var_name, info);
}
- char* buffer = Isolate::Current()->current_zone()->Alloc<char>(len);
+ char* buffer = Isolate::Current()->current_zone()->Alloc<char>(len + 1);
+ buffer[0] = '\0';
intptr_t num_chars = 0;
for (intptr_t i = 0; i < Length(); i++) {
RawLocalVarDescriptors::VarInfo info;
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698