From bd2cc03c2bb8457727ee487a9152790c04837d8c Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 15 Feb 2022 09:33:54 -0700 Subject: [DAM analyzer] Track null values in analyzer (#2604) This tracks null values and adjusts the handling of null values in a few intrinsics which either take structs that can never be null, or don't return when the input is null. MethodBodyScanner needed a small adjustment to correctly deal with the case where an intrinsic returns TopValue. --- test/Mono.Linker.Tests.Cases/DataFlow/AssemblyQualifiedNameDataflow.cs | 2 -- test/Mono.Linker.Tests.Cases/DataFlow/TypeHandleDataFlow.cs | 2 -- .../Reflection/RunClassConstructorUsedViaReflection.cs | 2 -- 3 files changed, 6 deletions(-) (limited to 'test/Mono.Linker.Tests.Cases') diff --git a/test/Mono.Linker.Tests.Cases/DataFlow/AssemblyQualifiedNameDataflow.cs b/test/Mono.Linker.Tests.Cases/DataFlow/AssemblyQualifiedNameDataflow.cs index b03fe04b0..0a9cf094a 100644 --- a/test/Mono.Linker.Tests.Cases/DataFlow/AssemblyQualifiedNameDataflow.cs +++ b/test/Mono.Linker.Tests.Cases/DataFlow/AssemblyQualifiedNameDataflow.cs @@ -63,8 +63,6 @@ namespace Mono.Linker.Tests.Cases.DataFlow RequirePublicConstructors ("System.Invalid.TypeName"); } - // https://github.com/dotnet/linker/issues/2528 - [ExpectedWarning ("IL2072", nameof (RequirePublicConstructors), ProducedBy = ProducedBy.Analyzer)] static void TestNull () { Type type = null; diff --git a/test/Mono.Linker.Tests.Cases/DataFlow/TypeHandleDataFlow.cs b/test/Mono.Linker.Tests.Cases/DataFlow/TypeHandleDataFlow.cs index e00bfd202..507f532e5 100644 --- a/test/Mono.Linker.Tests.Cases/DataFlow/TypeHandleDataFlow.cs +++ b/test/Mono.Linker.Tests.Cases/DataFlow/TypeHandleDataFlow.cs @@ -64,8 +64,6 @@ namespace Mono.Linker.Tests.Cases.DataFlow Type.GetTypeFromHandle (typeWithMethods.TypeHandle).RequiresPublicMethods (); } - // https://github.com/dotnet/linker/issues/2528 - [ExpectedWarning ("IL2072", nameof (Type.GetTypeFromHandle), nameof (DataFlowTypeExtensions.RequiresPublicMethods), ProducedBy = ProducedBy.Analyzer)] static void TestNull () { Type type = null; diff --git a/test/Mono.Linker.Tests.Cases/Reflection/RunClassConstructorUsedViaReflection.cs b/test/Mono.Linker.Tests.Cases/Reflection/RunClassConstructorUsedViaReflection.cs index 02e47c545..0744577ec 100644 --- a/test/Mono.Linker.Tests.Cases/Reflection/RunClassConstructorUsedViaReflection.cs +++ b/test/Mono.Linker.Tests.Cases/Reflection/RunClassConstructorUsedViaReflection.cs @@ -33,8 +33,6 @@ namespace Mono.Linker.Tests.Cases.Reflection } [Kept] - // https://github.com/dotnet/linker/issues/2528 - [ExpectedWarning ("IL2059", nameof (RuntimeHelpers) + "." + nameof (RuntimeHelpers.RunClassConstructor), ProducedBy = ProducedBy.Analyzer)] static void TestNull () { Type type = null; -- cgit v1.2.3