diff options
author | Andreas Gampe <agampe@google.com> | 2014-06-12 15:44:40 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-06-12 15:53:48 -0700 |
commit | 9f2b6433c17ec8ea30015fd1b20e7a0ad3d4159e (patch) | |
tree | 33a9aa6ad2daa87a9355248db2fc9b1b430ae97a /runtime/verifier | |
parent | cbaa3076b51db805c5e74636d77c8c7cbd79d125 (diff) | |
download | art-9f2b6433c17ec8ea30015fd1b20e7a0ad3d4159e.zip art-9f2b6433c17ec8ea30015fd1b20e7a0ad3d4159e.tar.gz art-9f2b6433c17ec8ea30015fd1b20e7a0ad3d4159e.tar.bz2 |
ART: Invoke_virtual needs at least receiver parameter
Makes the method verifier reject invoke_virtual instructions that
claim they do not need any parameters.
Bug: 15570946
Change-Id: Ia76fddb7a08551d6c08654950e7085f09eacf430
Diffstat (limited to 'runtime/verifier')
-rw-r--r-- | runtime/verifier/method_verifier.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/verifier/method_verifier.cc b/runtime/verifier/method_verifier.cc index e5dcbb0..487ecde 100644 --- a/runtime/verifier/method_verifier.cc +++ b/runtime/verifier/method_verifier.cc @@ -2131,6 +2131,9 @@ bool MethodVerifier::CodeFlowVerifyInstruction(uint32_t* start_guess) { case Instruction::INVOKE_VIRTUAL_RANGE: case Instruction::INVOKE_SUPER: case Instruction::INVOKE_SUPER_RANGE: { + if (inst->VRegA() == 0) { + Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "invoke_virtual/super needs at least receiver"; + } bool is_range = (inst->Opcode() == Instruction::INVOKE_VIRTUAL_RANGE || inst->Opcode() == Instruction::INVOKE_SUPER_RANGE); bool is_super = (inst->Opcode() == Instruction::INVOKE_SUPER || |