diff --git a/src/mono/mono/metadata/class-inlines.h b/src/mono/mono/metadata/class-inlines.h index 7c8a61ae5b8e79af0275233c12c42c3fd2658374..a9aa3c992a5416140ae991f5cf56f51183b8d7ed 100644 --- a/src/mono/mono/metadata/class-inlines.h +++ b/src/mono/mono/metadata/class-inlines.h @@ -217,6 +217,18 @@ m_method_is_virtual (MonoMethod *method) return (method->flags & METHOD_ATTRIBUTE_VIRTUAL) != 0; } +static inline gboolean +m_method_is_abstract (MonoMethod *method) +{ + return (method->flags & METHOD_ATTRIBUTE_ABSTRACT) != 0; +} + +static inline gboolean +m_method_is_final (MonoMethod *method) +{ + return (method->flags & METHOD_ATTRIBUTE_FINAL) != 0; +} + static inline gboolean m_method_is_icall (MonoMethod *method) { diff --git a/src/mono/mono/metadata/icall.c b/src/mono/mono/metadata/icall.c index b340e0b041cd2f69bf0a5c23f8b08eece2393cd7..014b69b043334c661c43e227b1ea2df905626e85 100644 --- a/src/mono/mono/metadata/icall.c +++ b/src/mono/mono/metadata/icall.c @@ -2532,7 +2532,7 @@ method_is_reabstracted (MonoMethod *method) /* only on interfaces */ /* method is marked "final abstract" */ /* FIXME: we need some other way to detect reabstracted methods. "final" is an incidental detail of the spec. */ - return method->flags & METHOD_ATTRIBUTE_FINAL && method->flags & METHOD_ATTRIBUTE_ABSTRACT; + return m_method_is_final (method) && m_method_is_abstract (method); } static gboolean @@ -2540,7 +2540,7 @@ method_is_dim (MonoMethod *method) { /* only valid on interface methods*/ /* method is marked "virtual" but not "virtual abstract" */ - return method->flags & method->flags & METHOD_ATTRIBUTE_VIRTUAL && !(method->flags & METHOD_ATTRIBUTE_ABSTRACT); + return m_method_is_virtual (method) && !m_method_is_abstract (method); } static gboolean @@ -2582,9 +2582,8 @@ set_interface_map_data_method_object (MonoMethod *method, MonoClass *iclass, int * the method), then say the target method is null. */ if (method_is_reabstracted (method) && - ((foundMethod->flags & METHOD_ATTRIBUTE_ABSTRACT) || - (mono_class_is_interface (foundMethod->klass) && method_is_dim (foundMethod)) - )) + (m_method_is_abstract (foundMethod) || + (mono_class_is_interface (foundMethod->klass) && method_is_dim (foundMethod)))) MONO_HANDLE_ARRAY_SETREF (targets, i, NULL_HANDLE); else if (mono_class_is_interface (foundMethod->klass) && method_is_reabstracted (foundMethod) && !m_class_is_abstract (klass)) { /* if the method we found is a reabstracted DIM method, but the class isn't abstract, return NULL */