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