/// <summary> /// Initialises the analysis singletons. /// </summary> private void initialiseAnalysisSingletons() { ControlFlowGraph.ControlFlowGraph cfg = ControlFlowGraph.ControlFlowGraph.FromSource("<? $a = 1; echo $a; ?>", FileName); var analysis = new Weverca.Analysis.ForwardAnalysis(cfg, MemoryModel); analysis.Analyse(); }
/// <summary> /// Analyses CFG and return PPG generated by forward analysis /// </summary> /// <param name="entryMethod">Start point CFG of PHP code</param> /// <param name="memoryModel">The memory model used for analysis</param> /// <returns>PPG generated by forward analysis</returns> internal static ProgramPointGraph Analyze(ControlFlowGraph.ControlFlowGraph entryMethod, MemoryModels.MemoryModelFactory memoryModel) { //ForwardAnalysisBase forwardAnalysis = analysis.CreateAnalysis(entryMethod, memoryModel); ForwardAnalysisBase forwardAnalysis = new Weverca.Analysis.ForwardAnalysis(entryMethod, memoryModel); forwardAnalysis.Analyse(); return(forwardAnalysis.ProgramPointGraph); }