From f9468a5ad69edbb92f7b0998960383787cf9cbb1 Mon Sep 17 00:00:00 2001 From: Jeff Hao Date: Tue, 6 Aug 2013 15:35:47 -0700 Subject: Verifier checks that primitive put array/field type matches insn type. Change-Id: Idd68a36d26451459e55fc586bbd1e71c51a81be9 (cherry picked from commit a464748006d101407108c3d9eefd865c44cce695) --- runtime/verifier/method_verifier.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc index 8ba7ed7..9bedf6d 100644 --- a/runtime/verifier/method_verifier.cc +++ b/runtime/verifier/method_verifier.cc @@ -3304,7 +3304,7 @@ void MethodVerifier::VerifyPrimitivePut(const RegType& target_type, const RegTyp bool value_compatible; const RegType& value_type = work_line_->GetRegisterType(vregA); if (target_type.IsIntegralTypes()) { - instruction_compatible = insn_type.IsIntegralTypes(); + instruction_compatible = target_type.Equals(insn_type); value_compatible = value_type.IsIntegralTypes(); } else if (target_type.IsFloat()) { instruction_compatible = insn_type.IsInteger(); // no put-float, so expect put-int @@ -3491,8 +3491,8 @@ void MethodVerifier::VerifyISGet(const Instruction* inst, const RegType& insn_ty const uint32_t vregA = (is_static) ? inst->VRegA_21c() : inst->VRegA_22c(); if (is_primitive) { if (field_type.Equals(insn_type) || - (field_type.IsFloat() && insn_type.IsIntegralTypes()) || - (field_type.IsDouble() && insn_type.IsLongTypes())) { + (field_type.IsFloat() && insn_type.IsInteger()) || + (field_type.IsDouble() && insn_type.IsLong())) { // expected that read is of the correct primitive type or that int reads are reading // floats or long reads are reading doubles } else { -- cgit v1.1