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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1769183003: Fix sticky error propagation from thread to isolate (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: g Created 4 years, 9 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/isolate.h » ('j') | 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 3b944879423ec998be1a7257025eca1fb45ec39a..4f2499449116cce4006c9a958932f38254397023 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -1605,10 +1605,13 @@ static void RunLoopDone(uword param) {
DART_EXPORT Dart_Handle Dart_RunLoop() {
- Thread* T = Thread::Current();
- Isolate* I = T->isolate();
- CHECK_API_SCOPE(T);
- CHECK_CALLBACK_STATE(T);
+ Isolate* I;
+ {
+ Thread* T = Thread::Current();
+ I = T->isolate();
+ CHECK_API_SCOPE(T);
+ CHECK_CALLBACK_STATE(T);
+ }
API_TIMELINE_BEGIN_END;
// The message handler run loop does not expect to have a current isolate
// so we exit the isolate here and enter it again after the runloop is done.
@@ -1627,13 +1630,14 @@ DART_EXPORT Dart_Handle Dart_RunLoop() {
}
}
::Dart_EnterIsolate(Api::CastIsolate(I));
- if (T->sticky_error() != Object::null()) {
- Dart_Handle error = Api::NewHandle(T, T->sticky_error());
- T->clear_sticky_error();
+ if (I->sticky_error() != Object::null()) {
+ Dart_Handle error =
+ Api::NewHandle(Thread::Current(), I->sticky_error());
+ I->clear_sticky_error();
return error;
}
if (FLAG_print_class_table) {
- HANDLESCOPE(T);
+ HANDLESCOPE(Thread::Current());
I->class_table()->Print();
}
return Api::Success();
« no previous file with comments | « no previous file | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698