Verifier checks that primitive put array/field type matches insn type.
Change-Id: Idd68a36d26451459e55fc586bbd1e71c51a81be9
(cherry picked from commit a464748006d101407108c3d9eefd865c44cce695)
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 @@
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 @@
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 {