summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorJeff Hao <jeffhao@google.com>2014-04-24 23:55:44 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-04-24 23:55:44 +0000
commit81d79dc3e2a5e92c65bad955f2bea7ee161f66aa (patch)
treecb83846e767923cb6a4b78839e724845c95bfd4f /runtime
parentaa5d55fb3259525d8d2e930f4ec7cb193646fb57 (diff)
parentb878f2133a04593643228eb1d47993092528b963 (diff)
downloadart-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.cc8
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 = &reg_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 {