Pointer and alias analysis
Problems
- Alias analysis
Decide whether two memory references in a program may, or must, refer to the same location.
core - Call graph construction
Find a sound superset of the targets of each call site of a program with virtual or indirect calls, from type or pointer facts.
core - Points-to analysis
For each pointer variable, find a set of abstract memory locations, such as allocation sites, that it may point to.
core - Mod-ref analysis
For each call or procedure, find the memory locations it may modify and the ones it may read.
advanced
Algorithms
- 0-CFA
Find the functions that each expression of a higher-order program may evaluate to, with one abstract binding per variable, in cubic time.
1 languagescore - Andersen's analysis
Flow-insensitive points-to analysis that turns each assignment into a subset constraint and solves the constraint graph in cubic time.
1 languagescore - Class hierarchy analysis
Build a call graph from declared types. A virtual call y.m() may reach the method m of every class at or below the declared class of y.
1 languagescore - Rapid type analysis
Build a call graph like class hierarchy analysis, but let a virtual call reach only the classes that some reachable method creates with new.
1 languagescore - Steensgaard's analysis
Flow-insensitive points-to analysis that unifies the targets of both sides of each assignment, with union-find, in almost linear time.
1 languagescore - Escape analysis
Finds objects that do not outlive their method or thread, so they can be put on the stack and their locks removed.
1 languagesadvanced - Offline variable substitution
Finds variables with surely equal points-to sets before solving and merges them, which shrinks the constraint graph.
1 languagesadvanced - One-level flow analysis
Points-to analysis with subset constraints at the top pointer level and unification below. Das measured it nearly as precise as Andersen and nearly as fast as Steensgaard.
1 languagesadvanced - Online cycle elimination
Detects cycles in an inclusion constraint graph while solving and merges their nodes, since all nodes on a cycle have equal sets.
1 languagesadvanced - Type-based alias analysis
Decides that two references cannot alias when their declared types are incompatible under the rules of a type-safe language.
1 languagesadvanced - Variable type analysis
Prune a sound call graph by pushing the classes of new along the assignments of a type propagation graph and keeping the targets that reach each receiver.
1 languagesadvanced - k-CFA
Control flow analysis of higher-order programs that keeps a separate binding of each variable for each string of the last k call sites.
1 languagesadvanced - Demand-driven points-to analysis
Answers points-to queries for chosen variables only, by searching backward in the constraint graph, often as CFL reachability.
1 languagesresearch - Lazy and hybrid cycle detection
Looks for constraint cycles only when an edge brings no new points-to facts, plus an offline pass, making Andersen's analysis scale.
1 languagesresearch - Sparse flow-sensitive pointer analysis
Makes flow-sensitive points-to analysis scale by propagating facts only along def-use chains found by a cheaper pre-analysis.
1 languagesresearch
Techniques
- Object sensitivity
Context-sensitive pointer analysis for object-oriented code that tells calls apart by the allocation sites of their receiver objects.
advanced - BDD-based points-to analysis
Stores points-to relations and contexts as binary decision diagrams, which makes cloning-based context-sensitive analysis feasible.
research
Concepts
- Field sensitivity
Whether a pointer analysis keeps the fields of a structure or object apart as separate locations or merges them into one.
advanced
Theorems
- Undecidability of may-alias analysis
Precise intraprocedural may-alias analysis is undecidable for languages with recursive data structures and pointers.
advanced - EXPTIME-completeness of k-CFA
For every fixed k at least 1, deciding whether a function flows to a program point under k-CFA is complete for exponential time.
research - NP-hardness of precise flow-insensitive alias analysis
Deciding precise flow-insensitive may-alias is NP-hard, even with no dynamic memory, when statements may dereference a pointer many times.
research