BurtonQin / lockbud

Statically detect memory, concurrency bugs and possible panic locations for Rust.
BSD 3-Clause "New" or "Revised" License
445 stars 25 forks source link

why use the "instance" rather than implementing a block visitor to build the callgraph? #42

Closed ffanyq closed 1 year ago

BurtonQin commented 1 year ago

The implementation uses Instance::resolve to get the callee instance. https://github.com/BurtonQin/lockbud/blob/69e139995ea2fdbd0c25c389c753a66cf6e208ad/src/analysis/callgraph/mod.rs#L211

An instance is more suitable than a function's def_id in the analysis in that i) the instance here is fully instantiated, providing concrete type info and handy APIs. and ii) eliminating dead functions.

ffanyq commented 1 year ago

Thanks for your answer!