diff options
author | Andreas Gampe <agampe@google.com> | 2014-07-23 20:18:36 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-07-25 18:26:01 -0700 |
commit | dc13d7df5da49e93963035633a82699c68fa0971 (patch) | |
tree | 9e5b943745155b1bc72fc9b0d6856a85322e5c04 | |
parent | 80b3f96ec1e408f34b8e7b76b14774794fa1abd8 (diff) | |
download | art-dc13d7df5da49e93963035633a82699c68fa0971.zip art-dc13d7df5da49e93963035633a82699c68fa0971.tar.gz art-dc13d7df5da49e93963035633a82699c68fa0971.tar.bz2 |
ART: Allow arrays with erroneous component type
Array classes must tolerate having component type classes that are
erroneous. Change CreateArrayClass to use LookupClass when FindClass
failed.
Bug: 16019155
Change-Id: Id4868c5498431c85c199aa3cbecd23566dce3601
-rw-r--r-- | runtime/class_linker.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 7f89156..5599c21 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -2653,7 +2653,14 @@ mirror::Class* ClassLinker::CreateArrayClass(Thread* self, const char* descripto Handle<mirror::Class> component_type(hs.NewHandle(FindClass(self, descriptor + 1, class_loader))); if (component_type.Get() == nullptr) { DCHECK(self->IsExceptionPending()); - return nullptr; + // We need to accept erroneous classes as component types. + component_type.Assign(LookupClass(descriptor + 1, class_loader.Get())); + if (component_type.Get() == nullptr) { + DCHECK(self->IsExceptionPending()); + return nullptr; + } else { + self->ClearException(); + } } if (UNLIKELY(component_type->IsPrimitiveVoid())) { ThrowNoClassDefFoundError("Attempt to create array of void primitive type"); |