diff options
| author | 2013-10-04 17:43:55 -0700 | |
|---|---|---|
| committer | 2013-10-04 17:43:55 -0700 | |
| commit | 34633b22f74393344987a50b8aaee548a9dadc18 (patch) | |
| tree | f4df741c3563b1299781a5bfe32bea844cf619f2 | |
| parent | f1603c2d1c9da70a8e2e4d6af8cf62776ce6b035 (diff) | |
| parent | 5ce6f04f4ae2ea3a105a2bf77cc3ef57c856b157 (diff) | |
am 5ce6f04f: am 3057d341: am a6b22c5b: Verifier allows arguments of integral types to be interchangeable.
* commit '5ce6f04f4ae2ea3a105a2bf77cc3ef57c856b157':
Verifier allows arguments of integral types to be interchangeable.
| -rw-r--r-- | runtime/verifier/method_verifier.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc index 36b409d142..6b1ff7775c 100644 --- a/runtime/verifier/method_verifier.cc +++ b/runtime/verifier/method_verifier.cc @@ -3103,7 +3103,14 @@ mirror::ArtMethod* MethodVerifier::VerifyInvocationArgs(const Instruction* inst, } const RegType& reg_type = reg_types_.FromDescriptor(class_loader_, descriptor, false); uint32_t get_reg = is_range ? inst->VRegC_3rc() + actual_args : arg[actual_args]; - if (!work_line_->VerifyRegisterType(get_reg, reg_type)) { + if (reg_type.IsIntegralTypes()) { + const RegType& src_type = work_line_->GetRegisterType(get_reg); + if (!src_type.IsIntegralTypes()) { + Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "register v" << get_reg << " has type " << src_type + << " but expected " << reg_type; + return res_method; + } + } else if (!work_line_->VerifyRegisterType(get_reg, reg_type)) { return res_method; } actual_args = reg_type.IsLongOrDoubleTypes() ? actual_args + 2 : actual_args + 1; |