File tree 1 file changed +22
-11
lines changed
1 file changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -702,20 +702,31 @@ void taint_algorithm_computing_summary_of_functiont::initialise_domain(
702
702
const auto &fn_type=
703
703
program->get_functions ().function_map .at (callee_id).type ;
704
704
705
- for ( const auto &arg : fn_call. arguments ( ))
705
+ if (!database. contains (callee_id) || transition_rules-> has_rule (callee_id ))
706
706
{
707
- collect_lvsa_access_paths (
708
- arg,
709
- program->get_namespace (),
710
- environment,
711
- lvsa,
712
- it,
713
- *numbering);
707
+ // This is either a recursive function or a function for which we have
708
+ // a rule (any function not in the database has not been processed and
709
+ // since we're following an inverted topological ordering it therefore
710
+ // must recursively call us)
711
+ // If we don't have a summary then we assume that the function could
712
+ // use any of its arguments. If the function has a rule then it
713
+ // probably will use some of its arguments.
714
+ // In the future we could be more precise about exactly which arguments
715
+ // are used in the rule.
716
+ for (const auto &arg : fn_call.arguments ())
717
+ {
718
+ collect_lvsa_access_paths (
719
+ arg,
720
+ program->get_namespace (),
721
+ environment,
722
+ lvsa,
723
+ it,
724
+ *numbering);
725
+ }
726
+ if (!database.contains (callee_id))
727
+ continue ;
714
728
}
715
729
716
- if (!database.contains (callee_id))
717
- continue ;
718
-
719
730
const std::shared_ptr<taint_summaryt> summary = database.at (callee_id);
720
731
for (const std::pair<taint_lvalue_numbert, taint_variablet>& input
721
732
: summary->input )
You can’t perform that action at this time.
0 commit comments