Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackson Schuster <36744439+jtschuster@users.noreply.github.com>2022-09-27 19:26:10 +0300
committerGitHub <noreply@github.com>2022-09-27 19:26:10 +0300
commitae7e8fd1e5509c0da4d807867c02a26ad026f801 (patch)
tree0fa8e87ed0a3a5b318fe48359d68b14bb4a4bc87
parenta1207be89c9f9a1a3eec7f8c27cf2ce29fbab226 (diff)
Check for nulls in IsInterfaceImplementationNeededByTypeDueToInterface (#3050)
-rw-r--r--src/linker/Linker.Steps/MarkStep.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/linker/Linker.Steps/MarkStep.cs b/src/linker/Linker.Steps/MarkStep.cs
index dc026e7b9..5d4065d35 100644
--- a/src/linker/Linker.Steps/MarkStep.cs
+++ b/src/linker/Linker.Steps/MarkStep.cs
@@ -611,7 +611,7 @@ namespace Mono.Linker.Steps
if (bases is null)
continue;
foreach (var @base in bases) {
- if (@base.DeclaringType.IsInterface && IgnoreScope (@base.DeclaringType.Scope))
+ if (@base.DeclaringType is not null && @base.DeclaringType.IsInterface && IgnoreScope (@base.DeclaringType.Scope))
_interfaceOverrides.Add ((new OverrideInformation (@base, method, Context), ScopeStack.CurrentScope));
}
}
@@ -2406,6 +2406,9 @@ namespace Mono.Linker.Steps
{
var @base = overrideInformation.Base;
var method = overrideInformation.Override;
+ if (@base is null || method is null || @base.DeclaringType is null)
+ return false;
+
if (Annotations.IsMarked (method))
return false;