Ec (2); I will continue to submit reading program notes today. This time is relatively small and relatively simple. ConnectorComputation & nbsp;-compute () & nbsp; if there are other elements in the workList, continue the loop, but the first time you enter the loop, the workList has only one element according to the constructor. & lt; mai script ec (2); script
I will continue to submit reading program notes today. This time is relatively small and relatively simple.
ConnectorComputation
-Compute ()
If there are still elements in the workList, the cycle continues. However, when the first cycle is started, there is only one element in the workList according to the constructor. . Then, retrieve the first element from the workList, obtain TacFunction and CallString (gamma), and obtain ECS (ecs_p) from function2ECS according to TacFunction (p ), in fact, the TacFunction corresponding to the first element in functions2ECS is _ main. Obtain the position of gamma in ecs_p, that is, the position in a CallString linked list.
Then, iterate all the worker nodecall contained in the TacFunction p. For each callNode, obtain its callee (called function q) in q! If it is null, create a new CallString (gamma_2) with callNode, obtain the ECS (ecs_q) corresponding to q from function2ECS, and obtain the location of gamma_2 in ecs_q, if it is-1, gamma_2 is added to the CallStrings queue of ecs_q, and the elements created with q and gamma_2 are added to the workList, expand it.
What is the next expansion of ConnectorFunction is not useful because it is in the for loop and is an operation on local variables.
Call the makeCallGraph () method after the while loop ends.
-MakeCallGraph ()
First, initialize a CallGraph with mainFunction to obtain the method call list included in mainFunction processUs. Create a set named visited and add the mainFunction to the set.
When processUs is not empty, extract the callNode element in sequence to obtain its caller and callee. If callee! = Null: add an element to callGraph. If callee has not been processed, add all function calls it contains to processUs and put them into visited.
Checker
According to the initial supplied run-all.bat parameters, the aliases analyze and literal analyze are not actually performed, but gta. analyze () is performed, that is, only dependance analyze is actually executed. Vulns is determined based on the link.