コード例 #1
0
        /// <summary>
        /// Runs the first phase analysis.
        /// </summary>
        private void runFirstPhaseAnalysis()
        {
            State = AnalysisState.ForwardAnalysis;
            FirstPhaseInitialMemory = GC.GetTotalMemory(true);

            WatchFirstPhase.Start();

            try
            {
                firstPhaseAnalysis = new Weverca.Analysis.ForwardAnalysis(controlFlowGraph, MemoryModel);

                IsFirstPhaseStarted = true;
                firstPhaseAnalysis.Analyse();
            }
            finally
            {
                WatchFirstPhase.Stop();

                FirstPhaseEndMemory = GC.GetTotalMemory(true);

                if (IsFirstPhaseStarted)
                {
                    programPointGraph = firstPhaseAnalysis.ProgramPointGraph;

                    analysisWarnings = AnalysisWarningHandler.GetWarnings();
                    securityWarnings = AnalysisWarningHandler.GetSecurityWarnings();
                }
            }

            if (IsFirstPhaseStarted)
            {
                IsFirstPhaseFinished = true;
            }
        }
コード例 #2
0
        internal static ProgramPointGraph GetAnalyzedGraph(TestCase test, ForwardAnalysisBase analysis)
        {
            test.ApplyTestSettings((TestAnalysisSettings)analysis);

            test.EnvironmentInitializer(analysis.EntryInput);

            analysis.Analyse();

            return(analysis.ProgramPointGraph);
        }