-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't return null target methods in GetInterfaceMap for abstract classes, or classes using DIMs #53972
Conversation
Tagging subscribers to this area: @CoffeeFlux Issue DetailsThe only case where we should be getting nulls back is for reabstracted DIMs. Otherwise we should be returning either the abstract method from the abstract class (or its ancestor classes) or a default interface method. Fixes #53933
|
Regression tests for dotnet#53933
Once it's reviewed, we need to sync this back to mono/mono |
Failures are related. Needs more work |
If the iterface method is reabstracted, and either the found implementation method is abstract, or the found implementation method is from another DIM (meaning neither klass nor any of its ancestor classes implemented the method), then say the target method is null. Otherwise return the found implementation method, even if it is abstract, unless we found a reabstracted method in a non-abstract class Fixes dotnet#53933
Ready for review |
@vargaz please review |
/* 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); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some accessors like m_method_is_virtual () etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks wrong.
@vargaz do you mean not using the accessor is wrong, or checking for a default interface method using the method flags is wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part:
method->flags & method->flags & METHOD_ATTRIBUTE_VIRTUAL
/azp run sync-runtime-to-mono |
Azure Pipelines successfully started running 1 pipeline(s). |
…ses, or classes using DIMs If the interface method is reabstracted, and either the found implementation method is abstract, or the found implementation method is from another DIM (meaning neither klass nor any of its ancestor classes implemented the method), then say the target method is null. Otherwise return the found implementation method, even if it is abstract. Corresponding dotnet/runtime PR is dotnet/runtime#53972 Fixes dotnet/runtime#53933
…ses, or classes using DIMs (#21112) * Don't return null target methods in GetInterfaceMap for abstract classes, or classes using DIMs If the interface method is reabstracted, and either the found implementation method is abstract, or the found implementation method is from another DIM (meaning neither klass nor any of its ancestor classes implemented the method), then say the target method is null. Otherwise return the found implementation method, even if it is abstract. Corresponding dotnet/runtime PR is dotnet/runtime#53972 Fixes dotnet/runtime#53933 * Add method flags accessors; cleanup interface map code Ported from dotnet/runtime#54271
…ses, or classes using DIMs (mono#21112) * Don't return null target methods in GetInterfaceMap for abstract classes, or classes using DIMs If the interface method is reabstracted, and either the found implementation method is abstract, or the found implementation method is from another DIM (meaning neither klass nor any of its ancestor classes implemented the method), then say the target method is null. Otherwise return the found implementation method, even if it is abstract. Corresponding dotnet/runtime PR is dotnet/runtime#53972 Fixes dotnet/runtime#53933 * Add method flags accessors; cleanup interface map code Ported from dotnet/runtime#54271
If the interface method is reabstracted, and either the found implementation method is abstract, or the found implementation method is from another DIM (meaning neither klass nor any of its ancestor classes implemented the
method), then say the target method is null. Otherwise return the found implementation method, even if it is abstract.
Fixes #53933