Fix for vm test 019
Verify that a register holds the type expected by the instruction and
not the component type for an array store, we know at runtime problems
will result in array store exceptions.
Change-Id: I0b48692f0f969af914a1b7024b2cd80d21ed6aed
diff --git a/src/dex_verifier.cc b/src/dex_verifier.cc
index 9094067..6f1084d 100644
--- a/src/dex_verifier.cc
+++ b/src/dex_verifier.cc
@@ -3294,7 +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
- work_line_->VerifyRegisterType(dec_insn.vA_, component_type);
+ // 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);
}
}
}