File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -436,12 +436,30 @@ void string_dependenciest::add_dependency(
436436 const array_string_exprt &e,
437437 const builtin_function_nodet &builtin_function_node)
438438{
439+ if (e.id () == ID_if)
440+ {
441+ const auto if_expr = to_if_expr (e);
442+ const auto &true_case = to_array_string_expr (if_expr.true_case ());
443+ const auto &false_case = to_array_string_expr (if_expr.false_case ());
444+ add_dependency (true_case, builtin_function_node);
445+ add_dependency (false_case, builtin_function_node);
446+ return ;
447+ }
439448 string_nodet &string_node = get_node (e);
440449 string_node.dependencies .push_back (builtin_function_node);
441450}
442451
443452void string_dependenciest::add_unknown_dependency (const array_string_exprt &e)
444453{
454+ if (e.id () == ID_if)
455+ {
456+ const auto if_expr = to_if_expr (e);
457+ const auto &true_case = to_array_string_expr (if_expr.true_case ());
458+ const auto &false_case = to_array_string_expr (if_expr.false_case ());
459+ add_unknown_dependency (true_case);
460+ add_unknown_dependency (false_case);
461+ return ;
462+ }
445463 string_nodet &string_node = get_node (e);
446464 string_node.depends_on_unknown_builtin_function = true ;
447465}
Original file line number Diff line number Diff line change @@ -343,7 +343,9 @@ class string_dependenciest
343343 const string_builtin_functiont &
344344 get_builtin_function (const builtin_function_nodet &node) const ;
345345
346- // / Add edge from node for `e` to node for `builtin_function`
346+ // / Add edge from node for `e` to node for `builtin_function` if `e` is a
347+ // / simple array expression. If it is an `if_exprt` we add the sub-expressions
348+ // / that are not `if_exprt`s instead.
347349 void add_dependency (
348350 const array_string_exprt &e,
349351 const builtin_function_nodet &builtin_function);
You can’t perform that action at this time.
0 commit comments