@@ -497,17 +497,14 @@ optionalt<exprt> string_dependenciest::eval(
497
497
return eval_string_cache[it->second ];
498
498
499
499
const auto node = string_nodes[it->second ];
500
-
501
- if (node.dependencies .size () == 1 )
500
+ const auto &f = node.result_from ;
501
+ if (
502
+ f && node.dependencies .size () == 1 &&
503
+ !node.depends_on_unknown_builtin_function )
502
504
{
503
- const auto &f = get_builtin_function (node.dependencies [0 ]);
504
- const auto result = f.string_result ();
505
- if (result && *result == s)
506
- {
507
- const auto value_opt = f.eval (get_value);
508
- eval_string_cache[it->second ] = value_opt;
509
- return value_opt;
510
- }
505
+ const auto value_opt = get_builtin_function (*f).eval (get_value);
506
+ eval_string_cache[it->second ] = value_opt;
507
+ return value_opt;
511
508
}
512
509
return {};
513
510
}
@@ -544,7 +541,11 @@ bool add_node(
544
541
if (
545
542
const auto &string_result =
546
543
dependencies.get_builtin_function (builtin_function_node).string_result ())
544
+ {
547
545
dependencies.add_dependency (*string_result, builtin_function_node);
546
+ auto &node = dependencies.get_node (*string_result);
547
+ node.result_from = builtin_function_node;
548
+ }
548
549
else
549
550
add_dependency_to_string_subexprs (
550
551
dependencies, *fun_app, builtin_function_node, array_pool);
0 commit comments