summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_builder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r--compiler/optimizing/instruction_builder.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc
index cd03e054b5..76ee456b55 100644
--- a/compiler/optimizing/instruction_builder.cc
+++ b/compiler/optimizing/instruction_builder.cc
@@ -957,6 +957,11 @@ static ArtMethod* ResolveMethod(uint16_t method_idx,
resolved_method, class_linker->GetImagePointerSize());
} else {
uint16_t vtable_index = resolved_method->GetMethodIndex();
+ if (vtable_index >= static_cast<uint32_t>(
+ compiling_class->GetSuperClass()->GetVTableLength())) {
+ // No super method. The runtime will throw a NoSuchMethodError.
+ return nullptr;
+ }
actual_method = compiling_class->GetSuperClass()->GetVTableEntry(
vtable_index, class_linker->GetImagePointerSize());
}