Skip to content

Commit ec6321f

Browse files
Ensure all atomic strings in arguments have node
We make sure a node is created for each atomic string in arguments of builtin functions. This allows us to restablish the check that a node exists for each dependency of a builtin function.
1 parent 68558ce commit ec6321f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/solvers/refinement/string_refinement_util.cpp

+10-4
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,15 @@ bool add_node(
339339
dependencies.add_dependency(*string_result, builtin_function_node);
340340
auto &node = dependencies.get_node(*string_result);
341341
node.result_from = builtin_function_node.index;
342+
343+
// Ensure all atomic strings in the argument have an associated node
344+
for(const auto arg : builtin_function_node.data->string_arguments())
345+
{
346+
for_each_atomic_string(
347+
arg, [&](const array_string_exprt &atomic) { // NOLINT
348+
(void)dependencies.get_node(atomic);
349+
});
350+
}
342351
}
343352
else
344353
add_dependency_to_string_subexprs(
@@ -366,10 +375,7 @@ void string_dependenciest::for_each_dependency(
366375
else if(const auto string_node = node_at(to_array_string_expr(current)))
367376
f(*string_node);
368377
else
369-
{
370-
std::cout << "Warning no node for " << format(current) << std::endl;
371-
//UNREACHABLE;
372-
}
378+
UNREACHABLE;
373379
}
374380
}
375381
}

0 commit comments

Comments
 (0)