OSDN Git Service

ART: Reject array-length on non-reference register
authorAndreas Gampe <agampe@google.com>
Mon, 28 Jul 2014 20:14:34 +0000 (13:14 -0700)
committerAndreas Gampe <agampe@google.com>
Mon, 28 Jul 2014 20:14:34 +0000 (13:14 -0700)
It should be a hard verifier failure if we detect an array-length
instruction over a non-reference-type register.

Bug: 16595896
Change-Id: I059510b15c846551b2f8ded86cfd8127543324f4

runtime/verifier/method_verifier.cc

index de792cb..2571cf1 100644 (file)
@@ -1775,6 +1775,8 @@ bool MethodVerifier::CodeFlowVerifyInstruction(uint32_t* start_guess) {
         } else {
           work_line_->SetRegisterType(inst->VRegA_12x(), reg_types_.Integer());
         }
+      } else {
+        Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "array-length on non-array " << res_type;
       }
       break;
     }