summaryrefslogtreecommitdiff
path: root/runtime/entrypoints/entrypoint_utils-inl.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/entrypoints/entrypoint_utils-inl.h')
-rw-r--r--runtime/entrypoints/entrypoint_utils-inl.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/entrypoints/entrypoint_utils-inl.h b/runtime/entrypoints/entrypoint_utils-inl.h
index 7ddf06f5ab..f0f8f8dce3 100644
--- a/runtime/entrypoints/entrypoint_utils-inl.h
+++ b/runtime/entrypoints/entrypoint_utils-inl.h
@@ -632,6 +632,13 @@ ALWAYS_INLINE ArtMethod* FindSuperMethodToCall(uint32_t method_idx,
}
if (referenced_class->IsInterface()) {
+ if (!resolved_method->GetDeclaringClass()->IsInterface()) {
+ // invoke-super from interface should not resolve to Object methods.
+ DCHECK(resolved_method->GetDeclaringClass()->IsObjectClass());
+ ThrowIncompatibleClassChangeError(
+ kSuper, resolved_method->GetInvokeType(), resolved_method, referrer);
+ return nullptr;
+ }
// TODO We can do better than this for a (compiled) fastpath.
ArtMethod* found_method = referenced_class->FindVirtualMethodForInterfaceSuper(
resolved_method, linker->GetImagePointerSize());