summaryrefslogtreecommitdiff
path: root/runtime/native/java_lang_VMClassLoader.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2019-04-11 13:37:10 -0700
committer Mathieu Chartier <mathieuc@google.com> 2019-04-16 20:13:01 +0000
commitef04ac6c05fa344428008ffa1eac7316c64a3467 (patch)
tree761ffc6c22a32f16dc3a42392f83c91ef23ef03d /runtime/native/java_lang_VMClassLoader.cc
parent1eb5d8770a533b86269e503a842f6b45591e87cf (diff)
Fix correctness for fast path class loading
For the fast path, we currently remove all exceptions and only return ClassNotFoundExceptions. This CL preserves exceptions that might occur such as linkage errors. The follow up is to add an additional fast path for faster class not found exception generation. Bug: 130310316 Bug: 130293184 Bug: 130209120 Test: test-art-host (cherry picked from commit ca19f9a8547999cb13de06458364d64ab143cb09) Merged-In: Iae55aaaae2be5b1330e8e54bee36e862cf9e12e0 Change-Id: I0fff3a748c07b5f3e05f4de24d56678a8b046844
Diffstat (limited to 'runtime/native/java_lang_VMClassLoader.cc')
-rw-r--r--runtime/native/java_lang_VMClassLoader.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/native/java_lang_VMClassLoader.cc b/runtime/native/java_lang_VMClassLoader.cc
index 46162c1989..11e02a2ce4 100644
--- a/runtime/native/java_lang_VMClassLoader.cc
+++ b/runtime/native/java_lang_VMClassLoader.cc
@@ -57,8 +57,12 @@ class VMClassLoader {
REQUIRES_SHARED(Locks::mutator_lock_) {
ObjPtr<mirror::Class> result;
if (cl->FindClassInBaseDexClassLoader(soa, self, descriptor, hash, class_loader, &result)) {
+ DCHECK(!self->IsExceptionPending());
return result;
}
+ if (self->IsExceptionPending()) {
+ self->ClearException();
+ }
return nullptr;
}
};