ART: Reject field accesses to non-reference vregs.
The verifier will now reject any iget/iput insts
that do not have a reference object in vB.
Bug: 17207857
Change-Id: I2826f0f7abfc88561f4da9486588592f4b296d14
Signed-off-by: Stuart Monteith <stuart.monteith@arm.com>
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc
index 69627f5..ce2ec54 100644
--- a/runtime/verifier/method_verifier.cc
+++ b/runtime/verifier/method_verifier.cc
@@ -3644,6 +3644,11 @@
} else if (obj_type.IsZero()) {
// Cannot infer and check type, however, access will cause null pointer exception
return field;
+ } else if (!obj_type.IsReferenceTypes()) {
+ // Trying to read a field from something that isn't a reference
+ Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "instance field access on object that has "
+ << "non-reference type " << obj_type;
+ return NULL;
} else {
mirror::Class* klass = field->GetDeclaringClass();
RegType& field_klass =