/// <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; } }
internal static ProgramPointGraph GetAnalyzedGraph(TestCase test, ForwardAnalysisBase analysis) { test.ApplyTestSettings((TestAnalysisSettings)analysis); test.EnvironmentInitializer(analysis.EntryInput); analysis.Analyse(); return(analysis.ProgramPointGraph); }
/// <summary> /// Clears the inner fields before new computation is performed. /// </summary> private void clearComputation() { AnalysisWarningHandler.ResetWarnings(); IsFirstPhaseStarted = false; IsSecondPhaseStarted = false; IsFirstPhaseFinished = false; IsSecondPhaseFinished = false; analysisWarnings = null; securityWarnings = null; secondPhaseWarnings = null; programPointGraph = null; firstPhaseAnalysis = null; secondPhaseAnalysis = null; // Force garbage collecting GC.Collect(); GC.WaitForPendingFinalizers(); }