diff options
author | Andreas Gampe <agampe@google.com> | 2015-03-23 10:10:20 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2015-03-26 15:03:46 -0700 |
commit | 16f149c2cb43a14d8f33d7d0fa36cd784e900f07 (patch) | |
tree | 299d484c007d373c68e22008ddedfacbd0c044f2 /runtime/mirror | |
parent | cac51526bbd03947676a8d49700425b19a57e447 (diff) | |
download | art-16f149c2cb43a14d8f33d7d0fa36cd784e900f07.tar.gz art-16f149c2cb43a14d8f33d7d0fa36cd784e900f07.tar.bz2 art-16f149c2cb43a14d8f33d7d0fa36cd784e900f07.zip |
ART: Change RETURN_OBJECT verification for arrays
Arrays appear to be valid (as according to spec), even if their
components are erroneous. If a component is erroneous, it may not
have loaded superclass or interface information, and so fail a
direct check for assignability.
Add a cutout that checks whether the declared return-type or the
actual return-type are arrays with erroneous components (and if so,
have the same 'depth'). In that case, generate a soft instead of a
hard error.
Also includes a fix to DumpClass.
Bug: 19683465
Change-Id: Ie73de03adeb0af7e939370d7363684fe125d7994
Diffstat (limited to 'runtime/mirror')
-rw-r--r-- | runtime/mirror/class.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc index 9fa6073698..29851a9d4f 100644 --- a/runtime/mirror/class.cc +++ b/runtime/mirror/class.cc @@ -228,8 +228,12 @@ void Class::DumpClass(std::ostream& os, int flags) { os << " interfaces (" << num_direct_interfaces << "):\n"; for (size_t i = 0; i < num_direct_interfaces; ++i) { Class* interface = GetDirectInterface(self, h_this, i); - const ClassLoader* cl = interface->GetClassLoader(); - os << StringPrintf(" %2zd: %s (cl=%p)\n", i, PrettyClass(interface).c_str(), cl); + if (interface == nullptr) { + os << StringPrintf(" %2zd: nullptr!\n", i); + } else { + const ClassLoader* cl = interface->GetClassLoader(); + os << StringPrintf(" %2zd: %s (cl=%p)\n", i, PrettyClass(interface).c_str(), cl); + } } } if (!IsLoaded()) { |