@@ -126,12 +126,12 @@ static void initialise_domain(
126
126
else if (it->type == FUNCTION_CALL)
127
127
{
128
128
code_function_callt const & fn_call = to_code_function_call (it->code );
129
- if (fn_call.function ().id () == ID_symbol)
129
+ const exprt &callee_expr = fn_call.function ();
130
+ if (callee_expr.id () == ID_symbol)
130
131
{
131
- std::string const callee_ident =
132
- as_string (to_symbol_expr (fn_call.function ()).get_identifier ());
133
-
134
- auto const & fn_type = functions_map.at (callee_ident).type ;
132
+ irep_idt callee_id = to_symbol_expr (callee_expr).get_identifier ();
133
+ const std::string callee_ident = as_string (callee_id);
134
+ const code_typet &fn_type = functions_map.at (callee_id).type ;
135
135
136
136
taint_summary_ptrt const summary =
137
137
database.find <taint_summaryt>(callee_ident);
@@ -390,9 +390,6 @@ static void build_symbols_substitution(
390
390
namespace_utilst nsu (ns);
391
391
auto parameter_indices=get_parameter_indices (fn_type);
392
392
393
- std::string const callee_ident =
394
- as_string (to_symbol_expr (fn_call.function ()).get_identifier ());
395
-
396
393
for (const std::pair<taint_lvaluet, taint_sett>& lvalue_taint : summary->input ())
397
394
{
398
395
assert (!lvalue_taint.second .is_bottom ());
@@ -947,20 +944,19 @@ numbered_lvalue_to_taint_mapt transform(
947
944
case FUNCTION_CALL:
948
945
{
949
946
const code_function_callt &fn_call = to_code_function_call (I.code );
950
- if (fn_call.function ().id () == ID_symbol)
947
+ const exprt &callee_expr = fn_call.function ();
948
+ if (callee_expr.id () == ID_symbol)
951
949
{
952
950
msg.debug () << " Recognised FUNCTION_CALL instruction." << messaget::eom;
953
951
954
- const std::string callee_ident =
955
- as_string (to_symbol_expr (fn_call.function ()).get_identifier ());
956
-
957
- const code_typet &fn_type = functions_map.at (callee_ident).type ;
952
+ irep_idt callee_id = to_symbol_expr (callee_expr).get_identifier ();
953
+ const std::string callee_ident = as_string (callee_id);
954
+ const code_typet &fn_type = functions_map.at (callee_id).type ;
958
955
959
956
assert (lvsa != nullptr );
960
957
// Find a matching rule
961
958
taint_rulest taint_rules;
962
- std::shared_ptr<taint_rulet> taint_rule =
963
- taint_rules.find (to_symbol_expr (fn_call.function ()));
959
+ std::shared_ptr<taint_rulet> taint_rule = taint_rules.find (callee_id);
964
960
// Find the summary
965
961
taint_summary_ptrt const summary =
966
962
database.find <taint_summaryt>(callee_ident);
@@ -1057,7 +1053,7 @@ numbered_lvalue_to_taint_mapt transform(
1057
1053
summary->output (),
1058
1054
symbols_substitution,
1059
1055
caller_ident,
1060
- callee_ident ,
1056
+ callee_id ,
1061
1057
fn_call,
1062
1058
fn_type,
1063
1059
ns,
@@ -1069,19 +1065,19 @@ numbered_lvalue_to_taint_mapt transform(
1069
1065
else
1070
1066
{
1071
1067
msg.warning ()
1072
- << " !!! WARNING !!! : No summary and no transition rule was "
1073
- " found for the called function "
1074
- << as_string (callee_ident)
1075
- << " So, we use identity as a transformation function."
1068
+ << " !!! WARNING !!! : No summary was found for the called function "
1069
+ << callee_ident
1070
+ << " Identity will be used as a transformation function."
1076
1071
<< messaget::eom;
1077
1072
}
1078
1073
}
1079
1074
else
1080
1075
msg.warning ()
1081
- << " !!! WARNING !!! : Recognised FUNCTION_CALL instruction "
1082
- " using non-identifier call expression. Such call is not "
1083
- " supported. So, we use identity as a transformation "
1084
- " function." << messaget::eom;
1076
+ << " !!! WARNING !!! : Recognised FUNCTION_CALL instruction using a "
1077
+ " non-identifier call expression. All such calls should have been "
1078
+ " removed by the remove-function-pointers pass."
1079
+ " Identity will be used as a transformation function."
1080
+ << messaget::eom;
1085
1081
}
1086
1082
break ;
1087
1083
case OTHER:
0 commit comments