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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 15353002: Add a call to CheckIsolateState in all paths of Dart_GetField and Dart_SetField. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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/class_finalizer.cc ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 22888)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -3934,10 +3934,14 @@
RETURN_TYPE_ERROR(isolate, name, String);
}
- const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(container));
-
+ // Finalize all classes.
+ Dart_Handle state = Api::CheckIsolateState(isolate);
+ if (::Dart_IsError(state)) {
+ return state;
+ }
Field& field = Field::Handle(isolate);
Function& getter = Function::Handle(isolate);
+ const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(container));
if (obj.IsNull()) {
return Api::NewError("%s expects argument 'container' to be non-null.",
CURRENT_FUNC);
@@ -3973,11 +3977,6 @@
return Api::NewHandle(isolate, DartEntry::InvokeFunction(getter, args));
} else if (obj.IsClass()) {
- // Finalize all classes.
- Dart_Handle state = Api::CheckIsolateState(isolate);
- if (::Dart_IsError(state)) {
- return state;
- }
// To access a static field we may need to use the Field or the
// getter Function.
const Class& cls = Class::Cast(obj);
@@ -4000,8 +3999,6 @@
}
} else if (obj.IsLibrary()) {
- // TODO(turnidge): Do we need to call CheckIsolateState here?
-
// To access a top-level we may need to use the Field or the
// getter Function. The getter function may either be in the
// library or in the field's owner class, depending.
@@ -4061,6 +4058,11 @@
Instance& value_instance = Instance::Handle(isolate);
value_instance ^= value_obj.raw();
+ // Finalize all classes.
+ Dart_Handle state = Api::CheckIsolateState(isolate);
+ if (::Dart_IsError(state)) {
+ return state;
+ }
Field& field = Field::Handle(isolate);
Function& setter = Function::Handle(isolate);
const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(container));
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698