Patent ID: 8056066

Claim:
A computer implemented method for obtaining aliasing information for a target variable in a computer program, the computer implemented method comprising: generating a control flow graph for the computer program that includes a plurality of nodes having references to the target variable, and wherein each node in the plurality of nodes is a basic block of code in the computer program; identifying all variables that have an address assigned to another variable within the computer program to form candidate variables by traversing each basic block of code in the control flow graph; selecting a candidate variable from the candidate variables to form the target variable; partitioning the control flow graph representing the computer program into a taken address portion and an untaken address portion of the control flow graph by identifying intermediary nodes in the taken address portion that act as a layer between the taken address portion and the untaken address portion, performing a breadth first traversal to find all reachable nodes from each intermediary node that acts as the layer between the taken address portion and the untaken address portion in the control flow graph, and adding all the reachable nodes from each intermediary node to the taken address portion to form a modified computer program, wherein the taken address portion comprises all the reachable nodes within the plurality of nodes in the control flow graph at which the address of the target variable is taken, and wherein the untaken address portion comprises all other reachable nodes within the plurality of nodes; replacing, in the untaken address portion of the modified computer program, all references to the target variable with a temporary variable; determining whether a node in the control flow graph is an intermediary node; responsive to a determination that a node in the control flow graph is an intermediary node, determining whether the target variable is able to be restored at the intermediary node; responsive to a determination that the target variable is not able to be restored at the intermediary node, creating a landing pad node that has a value of the temporary variable assigned to the target variable, inserting the landing pad node between the intermediary node and all predecessor nodes in the untaken address portion of the modified computer program, and assigning the value of the temporary variable to the target variable in the landing pad node; responsive to a determination that the target variable is able to be restored at the intermediary node, assigning the value of the temporary variable to the target variable prior to a point in the taken address porting of the modified computer program where the address of the target variable is taken; and generating the aliasing information for the target variable using the modified computer program.