@@ -520,14 +520,15 @@ numbered_lvalue_to_taint_mapt taint_algorithm_computing_summary_of_functiont::
520
520
void taint_algorithm_computing_summary_of_functiont::assign (
521
521
numbered_lvalue_to_taint_mapt &map,
522
522
const taint_lvalue_numbert lvalue,
523
- const taint_sett &taint)
523
+ const taint_sett &taint,
524
+ const bool allow_bottom_assignment)
524
525
{
525
526
TMPROF_BLOCK ();
526
527
527
528
const auto it = map.find (lvalue);
528
529
if (it == map.end ())
529
530
{
530
- if (!taint.is_bottom ())
531
+ if (!taint.is_bottom () || allow_bottom_assignment )
531
532
map.insert ({ lvalue, taint });
532
533
}
533
534
else
@@ -919,6 +920,26 @@ taint_sett taint_algorithm_computing_summary_of_functiont::
919
920
const auto input_it = input.find (lvalue_number);
920
921
if (input_it != input.cend ())
921
922
result += input_it->second ;
923
+ else
924
+ {
925
+ const exprt &alias_expr = numbering->at (lvalue_number);
926
+ if (alias_expr.id () == ID_dynamic_object)
927
+ {
928
+ const typet &alias_expr_type =
929
+ program->get_namespace ().follow (alias_expr.type ());
930
+ for (const auto &number_and_taint : a)
931
+ {
932
+ const exprt &expr = numbering->at (number_and_taint.first );
933
+ if (expr.id () == ID_external_value_set)
934
+ {
935
+ const typet &expr_type =
936
+ program->get_namespace ().follow (expr.type ());
937
+ if (alias_expr_type == expr_type)
938
+ result |= number_and_taint.second ;
939
+ }
940
+ }
941
+ }
942
+ }
922
943
}
923
944
}
924
945
return result;
@@ -943,7 +964,7 @@ void taint_algorithm_computing_summary_of_functiont::
943
964
// Singular implies that lhs has exactly one element,
944
965
// so we can access it directly
945
966
for (const auto num : numbers_of_aliases)
946
- assign (result, num, taint_from_rule);
967
+ assign (result, num, taint_from_rule, is_allowed_pure_assignment );
947
968
}
948
969
else
949
970
{
0 commit comments