summaryrefslogtreecommitdiff
path: root/runtime/class_linker.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2019-03-28 10:30:32 +0000
committer Vladimir Marko <vmarko@google.com> 2019-03-29 09:50:00 +0000
commitbb206de72135271e66e58576b1196f3e08d5b6fd (patch)
tree3ecbb781735b26d43628cf0f08673ce9908d69fd /runtime/class_linker.cc
parent5fdd1e84e0e3c4da0e6beac66a5cdd81c34bf399 (diff)
ObjPtr<>-ify ClassExt.
Test: m test-art-host-gtest Test: testrunner.py --host Bug: 31113334 Change-Id: If5fe3b9f6e10549b5ca3f395b0c83531cd3ba7a3
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r--runtime/class_linker.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index dde4f366de..80e0f462bc 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -175,7 +175,7 @@ static bool HasInitWithString(Thread* self, ClassLinker* class_linker, const cha
return exception_init_method != nullptr;
}
-static mirror::Object* GetVerifyError(ObjPtr<mirror::Class> c)
+static ObjPtr<mirror::Object> GetVerifyError(ObjPtr<mirror::Class> c)
REQUIRES_SHARED(Locks::mutator_lock_) {
ObjPtr<mirror::ClassExt> ext(c->GetExtData());
if (ext == nullptr) {
@@ -241,8 +241,8 @@ void ClassLinker::ThrowEarlierClassFailure(ObjPtr<mirror::Class> c,
Runtime* const runtime = Runtime::Current();
if (!runtime->IsAotCompiler()) { // Give info if this occurs at runtime.
std::string extra;
- if (GetVerifyError(c) != nullptr) {
- ObjPtr<mirror::Object> verify_error = GetVerifyError(c);
+ ObjPtr<mirror::Object> verify_error = GetVerifyError(c);
+ if (verify_error != nullptr) {
if (verify_error->IsClass()) {
extra = mirror::Class::PrettyDescriptor(verify_error->AsClass());
} else {
@@ -262,14 +262,15 @@ void ClassLinker::ThrowEarlierClassFailure(ObjPtr<mirror::Class> c,
ObjPtr<mirror::Throwable> pre_allocated = runtime->GetPreAllocatedNoClassDefFoundError();
self->SetException(pre_allocated);
} else {
- if (GetVerifyError(c) != nullptr) {
+ ObjPtr<mirror::Object> verify_error = GetVerifyError(c);
+ if (verify_error != nullptr) {
// Rethrow stored error.
HandleEarlierVerifyError(self, this, c);
}
// TODO This might be wrong if we hit an OOME while allocating the ClassExt. In that case we
// might have meant to go down the earlier if statement with the original error but it got
// swallowed by the OOM so we end up here.
- if (GetVerifyError(c) == nullptr || wrap_in_no_class_def) {
+ if (verify_error == nullptr || wrap_in_no_class_def) {
// If there isn't a recorded earlier error, or this is a repeat throw from initialization,
// the top-level exception must be a NoClassDefFoundError. The potentially already pending
// exception will be a cause.