Allow array length on null to pass verification.
Change-Id: I1986932cbd620702153286f191b3c7f3c91b31a7
diff --git a/src/dex_verifier.cc b/src/dex_verifier.cc
index 79f90e7..8793c95 100644
--- a/src/dex_verifier.cc
+++ b/src/dex_verifier.cc
@@ -2045,7 +2045,7 @@
case Instruction::ARRAY_LENGTH: {
const RegType& res_type = work_line_->GetRegisterType(dec_insn.vB_);
if (res_type.IsReferenceTypes()) {
- if (!res_type.IsArrayClass()) {
+ if (!res_type.IsArrayClass() && !res_type.IsZero()) { // ie not an array or null
Fail(VERIFY_ERROR_GENERIC) << "array-length on non-array " << res_type;
} else {
work_line_->SetRegisterType(dec_insn.vA_, reg_types_.Integer());