Exemple #1
0
 public override TaintedDataAnalysisContext ForkForInterproceduralAnalysis(
     IMethodSymbol invokedMethod,
     ControlFlowGraph invokedCfg,
     IOperation operation,
     PointsToAnalysisResult pointsToAnalysisResultOpt,
     DataFlowAnalysisResult <CopyBlockAnalysisResult, CopyAbstractValue> copyAnalysisResultOpt,
     DataFlowAnalysisResult <ValueContentBlockAnalysisResult, ValueContentAbstractValue> valueContentAnalysisResultOpt,
     InterproceduralTaintedDataAnalysisData interproceduralAnalysisData)
 {
     return(new TaintedDataAnalysisContext(
                this.ValueDomain,
                this.WellKnownTypeProvider,
                invokedCfg,
                invokedMethod,
                this.AnalyzerOptions,
                this.InterproceduralAnalysisConfiguration,
                this.PessimisticAnalysis,
                copyAnalysisResultOpt,
                pointsToAnalysisResultOpt,
                valueContentAnalysisResultOpt,
                this.TryGetOrComputeAnalysisResult,
                this.ControlFlowGraph,
                interproceduralAnalysisData,
                this.SourceInfos,
                this.SanitizerInfos,
                this.SinkInfos));
 }
Exemple #2
0
        public override TaintedDataAnalysisContext ForkForInterproceduralAnalysis(
            IMethodSymbol invokedMethod,
            ControlFlowGraph invokedCfg,
            IOperation operation,
            PointsToAnalysisResult pointsToAnalysisResultOpt,
            DataFlowAnalysisResult <CopyBlockAnalysisResult, CopyAbstractValue> copyAnalysisResultOpt,
            DataFlowAnalysisResult <ValueContentBlockAnalysisResult, ValueContentAbstractValue> valueContentAnalysisResultOpt,
            InterproceduralTaintedDataAnalysisData interproceduralAnalysisData)
        {
            Debug.Assert(copyAnalysisResultOpt == null);   // Just because we're not passing this argument along.
            Debug.Assert(valueContentAnalysisResultOpt == null);

            return(new TaintedDataAnalysisContext(
                       this.ValueDomain,
                       this.WellKnownTypeProvider,
                       invokedCfg,
                       invokedMethod,
                       this.InterproceduralAnalysisConfiguration,
                       this.PessimisticAnalysis,
                       pointsToAnalysisResultOpt,
                       this.TryGetOrComputeAnalysisResult,
                       this.ControlFlowGraph,
                       interproceduralAnalysisData,
                       this.SourceInfos,
                       this.SanitizerInfos,
                       this.SinkInfos));
        }
Exemple #3
0
        private TaintedDataAnalysisContext(
            AbstractValueDomain <TaintedDataAbstractValue> valueDomain,
            WellKnownTypeProvider wellKnownTypeProvider,
            ControlFlowGraph controlFlowGraph,
            ISymbol owningSymbol,
            AnalyzerOptions analyzerOptions,
            InterproceduralAnalysisConfiguration interproceduralAnalysisConfig,
            bool pessimisticAnalysis,
            CopyAnalysisResult copyAnalysisResultOpt,
            PointsToAnalysisResult pointsToAnalysisResult,
            ValueContentAnalysisResult valueContentAnalysisResult,
            Func <TaintedDataAnalysisContext, TaintedDataAnalysisResult> tryGetOrComputeAnalysisResult,
            ControlFlowGraph parentControlFlowGraph,
            InterproceduralTaintedDataAnalysisData interproceduralAnalysisDataOpt,
            TaintedDataSymbolMap <SourceInfo> taintedSourceInfos,
            TaintedDataSymbolMap <SanitizerInfo> taintedSanitizerInfos,
            TaintedDataSymbolMap <SinkInfo> taintedSinkInfos)
            : base(
                valueDomain,
                wellKnownTypeProvider,
                controlFlowGraph,
                owningSymbol,
                analyzerOptions,
                interproceduralAnalysisConfig,
                pessimisticAnalysis,
                predicateAnalysis: false,
                exceptionPathsAnalysis: false,
                copyAnalysisResultOpt,
                pointsToAnalysisResult,
                valueContentAnalysisResult,
                tryGetOrComputeAnalysisResult,
                parentControlFlowGraph,
                interproceduralAnalysisDataOpt,
                interproceduralAnalysisPredicateOpt: null)
        {
            Debug.Assert(pointsToAnalysisResult != null);

            this.SourceInfos    = taintedSourceInfos ?? throw new ArgumentNullException(nameof(taintedSourceInfos));
            this.SanitizerInfos = taintedSanitizerInfos ?? throw new ArgumentNullException(nameof(taintedSanitizerInfos));
            this.SinkInfos      = taintedSinkInfos ?? throw new ArgumentNullException(nameof(taintedSinkInfos));
        }