⚠️ [Documentation for RUPTA] is under development.
This framework supports context-sensitive pointer analysis on the Rust MIR.
The associated paper titled A Context-Sensitive Pointer Analysis Framework for Rust and Its Application to Call Graph Construction (CC '24).
- Rust nightly and componenets, as specified in rust-toolchain.
-
Clone the repository
-
Build & install
# You can build and install the cargo subcommand: $ cargo --locked install --path . # Or, you can only build the checker itself: $ cargo build
Before using this tool, make sure your Rust project compiles without any errors or warnings.
# You can run the pta for a rust project
$ cargo pta -- --entry <entry-function-name> --pta-type <pta-type> --context-depth <N> --dump-call-graph <call-graph-path> --dump-pts <pts-path>
# Or, you can directly run the pta for a single file
$ target/debug/pta <path-to-file> --entry <entry-function-name> --pta-type <pta-type> --context-depth <N> --dump-call-graph <call-graph-path> --dump-pts <pts-path>
<entry-function-name>
is the entry function. The default value ismain
.<pta-type>
is the pointer analysis type. Currently,cs
(context-sensitive
) andander
(andersen
) are supported. The default value iscs
.context-depth
controls the depth of contexts in a context-sensitive pointer analysis. The default value is 1.dump-call-graph
dumps the generated call graph in DOT format to the given path.dump-pts
dumps the points-to result to the given path.dump-mir
dumps the mir of reachable functions.
Set PTA_LOG
environment variable to enable logging:
$ export PTA_LOG=info
You may encounter error while loading shared libraries: librustc_driver.so, try setting:
$ export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib:$LD_LIBRARY_PATH
See LICENSE