diff options
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r-- | runtime/class_linker.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index b66dfebdbc..e0df6db24e 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -4220,6 +4220,14 @@ bool ClassLinker::InitializeClass(Thread* self, Handle<mirror::Class> klass, WrapExceptionInInitializer(klass); klass->SetStatus(mirror::Class::kStatusError, self); success = false; + } else if (Runtime::Current()->IsTransactionAborted()) { + // The exception thrown when the transaction aborted has been caught and cleared + // so we need to throw it again now. + LOG(WARNING) << "Return from class initializer of " << PrettyDescriptor(klass.Get()) + << " without exception while transaction was aborted: re-throw it now."; + Runtime::Current()->ThrowInternalErrorForAbortedTransaction(self); + klass->SetStatus(mirror::Class::kStatusError, self); + success = false; } else { RuntimeStats* global_stats = Runtime::Current()->GetStats(); RuntimeStats* thread_stats = self->GetStats(); |