OSDN Git Service

Make verifier identify unresolved methods as constructors by <init>.
authorJeff Hao <jeffhao@google.com>
Mon, 4 Aug 2014 21:47:17 +0000 (14:47 -0700)
committerJeff Hao <jeffhao@google.com>
Mon, 4 Aug 2014 21:47:17 +0000 (14:47 -0700)
Check was previously missing brackets in the method name.

Bug: 16560516
Change-Id: I6b28f8413f3d4c14269a6de38731213d7c964af6

runtime/verifier/method_verifier.cc

index 80c7283..5010b10 100644 (file)
@@ -3110,7 +3110,7 @@ mirror::ArtMethod* MethodVerifier::VerifyInvocationArgsFromIterator(T* it, const
       } else {
         // Check whether the name of the called method is "<init>"
         const uint32_t method_idx = (is_range) ? inst->VRegB_3rc() : inst->VRegB_35c();
-        if (strcmp(dex_file_->GetMethodName(dex_file_->GetMethodId(method_idx)), "init") != 0) {
+        if (strcmp(dex_file_->GetMethodName(dex_file_->GetMethodId(method_idx)), "<init>") != 0) {
           Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "'this' arg must be initialized";
           return nullptr;
         }