diff --git a/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/TaintedDataAnalysis/TaintedDataSymbolMapExtensions.cs b/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/TaintedDataAnalysis/TaintedDataSymbolMapExtensions.cs index aa9b3c8227..05b92a3aa0 100644 --- a/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/TaintedDataAnalysis/TaintedDataSymbolMapExtensions.cs +++ b/src/Utilities/FlowAnalysis/FlowAnalysis/Analysis/TaintedDataAnalysis/TaintedDataSymbolMapExtensions.cs @@ -37,8 +37,8 @@ internal static class TaintedDataSymbolMapExtensions [NotNullWhen(returnValue: true)] out PooledHashSet? allTaintedTargets) { allTaintedTargets = null; - PointsToAnalysisResult pointsToAnalysisResult = null; - ValueContentAnalysisResult valueContentAnalysisResult = null; + PointsToAnalysisResult? pointsToAnalysisResult = null; + ValueContentAnalysisResult? valueContentAnalysisResult = null; foreach (SourceInfo sourceInfo in sourceSymbolMap.GetInfosForType(method.ContainingType)) { foreach ((MethodMatcher methodMatcher, ImmutableHashSet taintedTargets) in sourceInfo.TaintedMethods) @@ -67,10 +67,7 @@ internal static class TaintedDataSymbolMapExtensions IEnumerable<(PointsToCheck, string target)> positivePointsToTaintedTargets = pointsToTaintedTargets.Where(s => s.pointsToCheck( arguments.Select(o => - // TODO(dotpaul): Remove the below suppression. -#pragma warning disable CS8602 // Dereference of a possibly null reference. pointsToAnalysisResult[o.Kind, o.Syntax]).ToImmutableArray())); -#pragma warning restore CS8602 // Dereference of a possibly null reference. if (positivePointsToTaintedTargets.Any()) { if (allTaintedTargets == null) @@ -96,11 +93,8 @@ internal static class TaintedDataSymbolMapExtensions IEnumerable<(ValueContentCheck, string target)> positiveValueContentTaintedTargets = valueContentTaintedTargets.Where(s => s.valueContentCheck( - // TODO(dotpaul): Remove the below suppression. -#pragma warning disable CS8602 // Dereference of a possibly null reference. arguments.Select(o => pointsToAnalysisResult[o.Kind, o.Syntax]).ToImmutableArray(), arguments.Select(o => valueContentAnalysisResult[o.Kind, o.Syntax]).ToImmutableArray())); -#pragma warning restore CS8602 // Dereference of a possibly null reference. if (positiveValueContentTaintedTargets.Any()) { if (allTaintedTargets == null)