Verify aput of primitives with component type
To work around the lack of typing causing int/float double/long
confusion.
Change-Id: I8ccb33793ca93f3155cd85c7ef9c9b3dc58d3527
diff --git a/src/dex_verifier.cc b/src/dex_verifier.cc
index 6f1084d..6c415e6 100644
--- a/src/dex_verifier.cc
+++ b/src/dex_verifier.cc
@@ -3294,9 +3294,9 @@
<< " incompatible with aput of type " << insn_type;
} else {
// The instruction agrees with the type of array, confirm the value to be stored does too
- // Note: we use the instruction type (rather than the component type) as incompatible
- // classes will be caught at runtime as an array store exception
- work_line_->VerifyRegisterType(dec_insn.vA_, insn_type);
+ // Note: we use the instruction type (rather than the component type) for aput-object as
+ // incompatible classes will be caught at runtime as an array store exception
+ work_line_->VerifyRegisterType(dec_insn.vA_, is_primitive ? component_type : insn_type);
}
}
}