facebookexperimental / MIRAI

Rust mid-level IR Abstract Interpreter
MIT License
1k stars 86 forks source link

Make k-limits into command line options #112

Open hermanventer opened 5 years ago

hermanventer commented 5 years ago

Issue

Currently a set of constants in checker/src/k_limits.rs provides limits on how much computation MIRAI will do in various places. With these limits in place, largish crates can be analyzed in a somewhat reasonable time frame. The limits do, however, impact on precision and may lead to false negatives. By making these into variables that can be set via command line options, it will become possible to schedule longer runs that may find more issues than more limited runs. The greater precision allowed by such runs can also be used to weed out false positives.

The recommended way to complete this task is to turn the constants in k_limits into the fields of a struct and to provide a constructor that sets the fields to default values, along with a command line processor that updates the values from options in the command line.

The limits struct should then be made part of the visitor state (checker/src/visitor.rs).

Ideally, there should also be a way to set these options to non default values for integration test cases. See also #52.

ryaneghrari commented 5 years ago

I began working on this issue, it appears that the k_limit constants also need to be integrated into callbacks (checker/src/callbacks.rs), is this correct?

hermanventer commented 5 years ago

Yes, you need to construct the limits struct in main.rs and pass it to the constructor of MiraiCallbacks, who then needs to pass it to the visitor.