Verifier checks that primitive put array/field type matches insn type.
Change-Id: Idd68a36d26451459e55fc586bbd1e71c51a81be9
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc
index c420ea6..bc3615f 100644
--- a/runtime/verifier/method_verifier.cc
+++ b/runtime/verifier/method_verifier.cc
@@ -3306,7 +3306,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
@@ -3492,8 +3492,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 {