diff options
author | Jeff Hao <jeffhao@google.com> | 2014-04-24 23:55:44 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-04-24 23:55:44 +0000 |
commit | 81d79dc3e2a5e92c65bad955f2bea7ee161f66aa (patch) | |
tree | cb83846e767923cb6a4b78839e724845c95bfd4f /runtime | |
parent | aa5d55fb3259525d8d2e930f4ec7cb193646fb57 (diff) | |
parent | b878f2133a04593643228eb1d47993092528b963 (diff) | |
download | art-81d79dc3e2a5e92c65bad955f2bea7ee161f66aa.zip art-81d79dc3e2a5e92c65bad955f2bea7ee161f66aa.tar.gz art-81d79dc3e2a5e92c65bad955f2bea7ee161f66aa.tar.bz2 |
Merge "Make unresolved exception types cause soft verification errors."
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/verifier/method_verifier.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc index 535c76d..b6fe4d5 100644 --- a/runtime/verifier/method_verifier.cc +++ b/runtime/verifier/method_verifier.cc @@ -2865,11 +2865,7 @@ const RegType& MethodVerifier::GetCaughtExceptionType() { common_super = ®_types_.JavaLangThrowable(false); } else { const RegType& exception = ResolveClassAndCheckAccess(iterator.GetHandlerTypeIndex()); - if (common_super == NULL) { - // Unconditionally assign for the first handler. We don't assert this is a Throwable - // as that is caught at runtime - common_super = &exception; - } else if (!reg_types_.JavaLangThrowable(false).IsAssignableFrom(exception)) { + if (!reg_types_.JavaLangThrowable(false).IsAssignableFrom(exception)) { if (exception.IsUnresolvedTypes()) { // We don't know enough about the type. Fail here and let runtime handle it. Fail(VERIFY_ERROR_NO_CLASS) << "unresolved exception class " << exception; @@ -2878,6 +2874,8 @@ const RegType& MethodVerifier::GetCaughtExceptionType() { Fail(VERIFY_ERROR_BAD_CLASS_SOFT) << "unexpected non-exception class " << exception; return reg_types_.Conflict(); } + } else if (common_super == nullptr) { + common_super = &exception; } else if (common_super->Equals(exception)) { // odd case, but nothing to do } else { |