← New search

Other meanings of Points-to analysis

Computer Science

Points-to analysis

Points-to analysis is a static program analysis that determines, for each pointer variable in a program, the set of memory locations or objects it may point to at runtime. It is a fundamental technique in compiler optimization, program verification, and security analysis, underpinning alias analysis and enabling transformations such as dead code elimination and parallelization.1

O(n^3)
Worst-case time complexity of Andersen's algorithm
Complexity
1979
Year of first formal formulation by Hecht
Year
~1000
Lines of code in typical implementation
Scale
1

Core Concepts and Algorithms

Points-to analysis computes a points-to set for each pointer, representing all possible targets. The two classic algorithms are Andersen's (subset-based, flow-insensitive) and Steensgaard's (unification-based). Andersen's is more precise but has cubic worst-case time, while Steensgaard's is near-linear but less precise. Modern implementations use context sensitivity and field sensitivity to improve precision, often via binary decision diagrams (BDDs) or sparse representations.

2

Applications in Compilers and Security

Compilers use points-to information for alias analysis, enabling optimizations like load/store elimination and automatic parallelization. In security, points-to analysis helps detect memory corruption vulnerabilities, such as use-after-free and double-free, by tracking pointer targets across program paths.2 It is also used in program slicing and refactoring tools.

3

Challenges and Scalability

Scalability is a major challenge for whole-program points-to analysis, especially in large object-oriented programs with dynamic dispatch. Techniques like pointer abstraction, heap cloning, and on-the-fly call graph construction mitigate this. Recent work uses machine learning to predict points-to sets, but traditional algorithms remain the standard.3

4

Lesser-known aspects

Points-to analysis has roots in dataflow analysis from the 1970s, with early work by Hecht and others. A niche variant, 'may-point-to' vs 'must-point-to', distinguishes possible from definite targets. In hardware description languages like Verilog, points-to analysis is used for pointer-like constructs in simulation. Also, some analyses handle 'unknown' pointers from external calls conservatively, affecting precision.

Glossary

Alias analysis
Determines when two pointers may refer to the same memory location.
Flow-insensitive
Ignores control flow order, treating the program as a set of statements.
Context-sensitive
Distinguishes calling contexts to improve precision.

Points-to analysis is a cornerstone of modern static analysis, balancing precision and scalability.