From 533b93e2c59e6b0fe13206b8dcad5ab9c1820cf9 Mon Sep 17 00:00:00 2001 From: Manish Vasani Date: Fri, 15 Nov 2019 18:22:54 -0800 Subject: [PATCH] Some more fixes --- .../TaintedDataSymbolMapExtensions.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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)