@@ -342,22 +342,6 @@ std::string taint_summaryt::description() const noexcept
342
342
// /
343
343
// //////////////////////////////////////////////////////////////////////////////
344
344
345
-
346
- symbol_exprt find_or_create_symbol_expr (
347
- const namespacet &ns,
348
- const irep_idt &symbol_name,
349
- const typet &symbol_type)
350
- {
351
- const symbolt *symbol_ptr;
352
- if (ns.lookup (symbol_name, symbol_ptr))
353
- {
354
- assert (false );
355
- return symbol_exprt (symbol_name, symbol_type);
356
- }
357
- assert (symbol_ptr!=nullptr );
358
- return symbol_ptr->symbol_expr ();
359
- }
360
-
361
345
// / \brief If the passed expression in a non-null pointer expression, then
362
346
// / the dereference expression is returned. Otherwise the original expression
363
347
// / is returned.
@@ -1143,7 +1127,7 @@ numbered_lvalue_to_taint_mapt taint_algorithm_computing_summary_of_functiont::
1143
1127
if (callee_expr.id ()==ID_symbol)
1144
1128
{
1145
1129
irep_idt callee_id = to_symbol_expr (callee_expr).get_identifier ();
1146
- const std::string callee_ident = as_string (callee_id);
1130
+ const std::string & callee_ident = as_string (callee_id);
1147
1131
const code_typet &fn_type =
1148
1132
program->get_functions ().function_map .at (callee_id).type ;
1149
1133
if (database.contains (callee_id))
@@ -1234,10 +1218,8 @@ numbered_lvalue_to_taint_mapt taint_algorithm_computing_summary_of_functiont::
1234
1218
&result_location))
1235
1219
{
1236
1220
// Update of return_value of the callee.
1237
- result_lvalue = find_or_create_symbol_expr (
1238
- program->get_namespace (),
1239
- callee_ident + RETURN_VALUE_SUFFIX,
1240
- fn_type.return_type ());
1221
+ result_lvalue = program->get_namespace ()
1222
+ .lookup (callee_ident + RETURN_VALUE_SUFFIX).symbol_expr ();
1241
1223
}
1242
1224
else if (
1243
1225
const taintable_location_argumentt *result_argument =
@@ -1300,10 +1282,8 @@ numbered_lvalue_to_taint_mapt taint_algorithm_computing_summary_of_functiont::
1300
1282
&sanitized_location))
1301
1283
{
1302
1284
// Update of return_value of the callee.
1303
- result_lvalue = find_or_create_symbol_expr (
1304
- program->get_namespace (),
1305
- callee_ident + RETURN_VALUE_SUFFIX,
1306
- fn_type.return_type ());
1285
+ result_lvalue = program->get_namespace ()
1286
+ .lookup (callee_ident + RETURN_VALUE_SUFFIX).symbol_expr ();
1307
1287
}
1308
1288
else if (
1309
1289
const taintable_location_argumentt *sanitized_argument =
0 commit comments