[release/7.0] [metadata] Skip null vtable entries when checking covariant return overrides #76324
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #76323 to release/7.0
/cc @lambdageek
Customer Impact
Customers using code that uses C# covariant returns in mobile or WebAssembly applications experienced crashes when using classes that re-abstracted virtual methods that had covariant returns in child subclasses. At least one commercial NuGet package used this pattern which prevented their customers from deploying the library in Android applications.
See dotnet/maui#6811
Testing
New CI test and manual testing
Risk
Low. The change affects validation done by the runtime while loading classes. A null pointer dereference is avoided. No existing checks are removed, no new checks are added. Code generation is unchanged. Any code that previously worked will continue to work.