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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1135173008: Fix for bug 23484 (obscure error when a compilation error happens during Object::Init()) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: fix-comment Created 5 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/bootstrap.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index bf2dfd144eece2a4c5d9e1fe4595526dcdab8de2..8dd7c2d5fbca796868e51b8dfa51b27212679270 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -1301,23 +1301,28 @@ DART_EXPORT Dart_Isolate Dart_CreateIsolate(const char* script_uri,
Thread::EnsureInit();
Isolate* isolate = Dart::CreateIsolate(isolate_name);
free(isolate_name);
- {
- StackZone zone(isolate);
- HANDLESCOPE(isolate);
- const Error& error_obj =
- Error::Handle(isolate,
- Dart::InitializeIsolate(snapshot, callback_data));
- if (error_obj.IsNull()) {
+ StackZone zone(isolate);
+ HANDLESCOPE(isolate);
+ // We enter an API scope here as InitializeIsolate could compile some
+ // bootstrap library files which call out to a tag handler that may create
+ // Api Handles when an error is encountered.
+ Dart_EnterScope();
+ const Error& error_obj =
+ Error::Handle(isolate, Dart::InitializeIsolate(snapshot, callback_data));
+ if (error_obj.IsNull()) {
#if defined(DART_NO_SNAPSHOT)
- if (FLAG_check_function_fingerprints) {
- Library::CheckFunctionFingerprints();
- }
-#endif // defined(DART_NO_SNAPSHOT).
- START_TIMER(isolate, time_total_runtime);
- return Api::CastIsolate(isolate);
+ if (FLAG_check_function_fingerprints) {
+ Library::CheckFunctionFingerprints();
}
- *error = strdup(error_obj.ToErrorCString());
- }
+#endif // defined(DART_NO_SNAPSHOT).
+ // We exit the API scope entered above.
+ Dart_ExitScope();
+ START_TIMER(isolate, time_total_runtime);
+ return Api::CastIsolate(isolate);
+ }
+ *error = strdup(error_obj.ToErrorCString());
+ // We exit the API scope entered above.
+ Dart_ExitScope();
Dart::ShutdownIsolate();
return DART_ILLEGAL_ISOLATE;
}
« no previous file with comments | « runtime/vm/bootstrap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698