Skip to content
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

[ILLlink] In DIM finding, exit early if the interface doesn't impl the DIM we're looking for #98436

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/tools/illink/src/linker/Linker/TypeMapInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Mono.Cecil;

namespace Mono.Linker
Expand Down Expand Up @@ -293,6 +294,10 @@ void FindAndAddDefaultInterfaceImplementations (TypeDefinition type, MethodDefin
if (potentialImplInterface == null)
continue;

// If the interface doesn't implement the interface with the method we're looking for, exit early
if (!potentialImplInterface.Interfaces.Any(i => context.TryResolve(i.InterfaceType) == interfaceMethod.DeclaringType))
continue;

bool foundImpl = false;

foreach (var potentialImplMethod in potentialImplInterface.Methods) {
Expand Down
Loading