/// <summary> /// Constructor. /// </summary> /// <param name="dfg">DataFlowGraph</param> internal TaintTrackingAnalysis(IGraph <IDataFlowNode> dfg) { this.AnalysisContext = dfg.EntryNode.Summary.AnalysisContext; this.SemanticModel = dfg.EntryNode.Summary.SemanticModel; this.Summary = dfg.EntryNode.Summary; this.DataFlowGraph = dfg; }
/// <summary> /// Constructor. /// </summary> /// <param name="context">AnalysisContext</param> /// <param name="method">BaseMethodDeclarationSyntax</param> /// <param name="parameterTypes">ITypeSymbols</param> private MethodSummary(FlowAnalysisContext context, BaseMethodDeclarationSyntax method, IDictionary <int, ISet <ITypeSymbol> > parameterTypes) { this.Id = MethodSummary.IdCounter++; this.AnalysisContext = context; this.SemanticModel = context.Compilation.GetSemanticModel(method.SyntaxTree); this.Method = method; this.SideEffectsInfo = new MethodSideEffectsInfo(this); this.ResolveMethodParameterTypes(parameterTypes); }
/// <summary> /// Constructor. /// </summary> /// <param name="dfgNode">DataFlowNode</param> /// <param name="context">AnalysisContext</param> internal DataFlowInfo(DataFlowNode dfgNode, FlowAnalysisContext context) { this.AnalysisContext = context; this.DataFlowNode = dfgNode; this.GeneratedDefinitions = new HashSet <SymbolDefinition>(); this.KilledDefinitions = new HashSet <SymbolDefinition>(); this.InputDefinitions = new HashSet <SymbolDefinition>(); this.OutputDefinitions = new HashSet <SymbolDefinition>(); this.TaintedDefinitions = new Dictionary <SymbolDefinition, ISet <SymbolDefinition> >(); }
/// <summary> /// Creates the summary of the specified method, using the /// specified parameter types. /// </summary> /// <param name="context">AnalysisContext</param> /// <param name="method">BaseMethodDeclarationSyntax</param> /// <param name="parameterTypes">ITypeSymbols</param> /// <returns>MethodSummary</returns> public static MethodSummary Create(FlowAnalysisContext context, BaseMethodDeclarationSyntax method, IDictionary <int, ISet <ITypeSymbol> > parameterTypes) { if (method.Body == null) { return(null); } var summary = new MethodSummary(context, method, parameterTypes); summary.BuildSummary(); summary.AnalyzeSummary(); return(summary); }
/// <summary> /// Creates the summary of the specified method. /// </summary> /// <param name="context">AnalysisContext</param> /// <param name="method">BaseMethodDeclarationSyntax</param> /// <returns>MethodSummary</returns> public static MethodSummary Create(FlowAnalysisContext context, BaseMethodDeclarationSyntax method) { return(MethodSummary.Create(context, method, new Dictionary <int, ISet <ITypeSymbol> >())); }