OSDN Git Service

Clear exception if FindClass fails.
authorNicolas Geoffray <ngeoffray@google.com>
Fri, 16 Dec 2016 16:14:39 +0000 (16:14 +0000)
committerNicolas Geoffray <ngeoffray@google.com>
Fri, 16 Dec 2016 16:14:39 +0000 (16:14 +0000)
Test: verifier_deps_test.
bug: 30937355
Change-Id: I9916ec00010de012939462d4f30147e8b64fe279

compiler/driver/compiler_driver.cc

index b6b2575..d1a5c4d 100644 (file)
@@ -2077,6 +2077,9 @@ void CompilerDriver::Verify(jobject jclass_loader,
               if (cls.Get() != nullptr) {
                 ObjectLock<mirror::Class> lock(soa.Self(), cls);
                 mirror::Class::SetStatus(cls, mirror::Class::kStatusVerified, soa.Self());
+              } else {
+                DCHECK(soa.Self()->IsExceptionPending());
+                soa.Self()->ClearException();
               }
               // Create `VerifiedMethod`s for each methods, the compiler expects one for
               // quickening or compiling.