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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 51123003: VM: Fix checked mode crash (issue 13831). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 | « no previous file | runtime/vm/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
===================================================================
--- runtime/vm/class_finalizer.cc (revision 29679)
+++ runtime/vm/class_finalizer.cc (working copy)
@@ -1218,6 +1218,19 @@
getter.set_result_type(type);
cls.AddFunction(getter);
field.set_value(Instance::Handle(Object::sentinel().raw()));
+
+ // Create initializer function.
+ // We don't have the start position of the initializer expression
+ // here, but can compute it from the field identifier position:
+ // The initializer expression starts after the assignment token at +2.
+ const intptr_t initializer_pos = field.token_pos() + 2;
hausner 2013/10/31 21:53:47 The + 2 is incorrect. The token position is a byte
Florian Schneider 2013/11/01 10:23:42 Oops, yes that will go wrong. I'll fix it. I think
+ const Function& init_function = Function::ZoneHandle(
+ Function::NewStaticInitializer(
+ String::Handle(field.name()),
+ type,
+ cls,
+ initializer_pos));
+ cls.AddFunction(init_function);
}
}
}
« no previous file with comments | « no previous file | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698