Index: runtime/vm/object_store.cc |
diff --git a/runtime/vm/object_store.cc b/runtime/vm/object_store.cc |
index a0feb38bb8eea238f547e4fc1fe72a674e12dda4..a4d22c14d7a71c8b928ec79f969c0afdc69c0852 100644 |
--- a/runtime/vm/object_store.cc |
+++ b/runtime/vm/object_store.cc |
@@ -79,6 +79,7 @@ ObjectStore::ObjectStore() |
resume_capabilities_(GrowableObjectArray::null()), |
exit_listeners_(GrowableObjectArray::null()), |
error_listeners_(GrowableObjectArray::null()), |
+ sticky_error_(Error::null()), |
empty_context_(Context::null()), |
stack_overflow_(Instance::null()), |
out_of_memory_(Instance::null()), |
@@ -105,6 +106,15 @@ ObjectStore::~ObjectStore() { |
} |
+void ObjectStore::SetStickyErrorFromThread(const Thread* thread) { |
+ if (thread->sticky_error() == Error::null()) { |
+ return; |
+ } |
+ ASSERT(sticky_error_ == Error::null()); |
+ sticky_error_ = thread->sticky_error(); |
+} |
+ |
+ |
void ObjectStore::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
ASSERT(visitor != NULL); |
visitor->VisitPointers(from(), to()); |