summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2020-05-09 14:48:35 +0100
committer Nicolas Geoffray <ngeoffray@google.com> 2020-05-10 11:49:17 +0000
commit3a079094a2b92a8dce725848d28abd5de7a84e9f (patch)
tree49e15ae32b994fe76424194c8377ac858c54c97c
parentd4c45e61847ad4243b9cfe189de6531e20319a55 (diff)
Don't run pre-verification if the thread cannot load classes.
In this situation (typically debuggable), the verifier will fail if verification of a class requires some classes to be loaded. Test: 689-zygote-jit-deopt Bug: 152552491 Change-Id: I8dd6da58c20dddf334965e6735cd6a7fade7bb97
-rw-r--r--runtime/jit/jit.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/jit/jit.cc b/runtime/jit/jit.cc
index f94c51ec60..df26ca43a5 100644
--- a/runtime/jit/jit.cc
+++ b/runtime/jit/jit.cc
@@ -879,6 +879,12 @@ class ZygoteVerificationTask final : public Task {
ZygoteVerificationTask() {}
void Run(Thread* self) override {
+ // We are going to load class and run verification, which may also need to load
+ // classes. If the thread cannot load classes (typically when the runtime is
+ // debuggable), then just return.
+ if (!self->CanLoadClasses()) {
+ return;
+ }
Runtime* runtime = Runtime::Current();
ClassLinker* linker = runtime->GetClassLinker();
const std::vector<const DexFile*>& boot_class_path =