summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/mirror/art_method-inl.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/mirror/art_method-inl.h b/runtime/mirror/art_method-inl.h
index 06700e6d51..58321c7117 100644
--- a/runtime/mirror/art_method-inl.h
+++ b/runtime/mirror/art_method-inl.h
@@ -163,7 +163,9 @@ inline bool ArtMethod::CheckIncompatibleClassChange(InvokeType type) {
return IsDirect() || (methods_class->IsInterface() && !IsMiranda());
}
case kSuper:
- return false; // TODO: appropriate checks for call to super class.
+ // Constructors and static methods are called with invoke-direct.
+ // Interface methods cannot be invoked with invoke-super.
+ return IsConstructor() || IsStatic() || GetDeclaringClass()->IsInterface();
case kInterface: {
Class* methods_class = GetDeclaringClass();
return IsDirect() || !(methods_class->IsInterface() || methods_class->IsObjectClass());