Make verifier identify unresolved methods as constructors by <init>.
Check was previously missing brackets in the method name.
Bug: 16560516
(cherry picked from commit 04ce113458b6b01f96d58dbb4c41682ee22d8b5d)
Change-Id: Ie98c5b84e73ffc43ea08e1b08ae9c6e41bcd5891
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc
index 18f7626..329b4dc 100644
--- a/runtime/verifier/method_verifier.cc
+++ b/runtime/verifier/method_verifier.cc
@@ -3111,7 +3111,7 @@
} 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;
}