RETURN_OK_WITH_ERROR();
}
- argc = xlat_flatten_compiled_argv(cc->tmp_ctx, &argv, head);
+ argc = xlat_flatten_to_argv(cc->tmp_ctx, &argv, head);
if (argc <= 0) {
fr_strerror_printf_push("ERROR in argument %d", (int) -argc);
RETURN_OK_WITH_ERROR();
xlat_exp_head_t const *head, xlat_escape_legacy_t escape, void const *escape_ctx)
CC_HINT(nonnull (2, 3, 4));
-int xlat_flatten_compiled_argv(TALLOC_CTX *ctx, xlat_exp_head_t ***argv, xlat_exp_head_t *head);
+int xlat_flatten_to_argv(TALLOC_CTX *ctx, xlat_exp_head_t ***argv, xlat_exp_head_t *head);
fr_slen_t xlat_tokenize_expression(TALLOC_CTX *ctx, xlat_exp_head_t **head, fr_sbuff_t *in,
fr_sbuff_parse_rules_t const *p_rules, tmpl_rules_t const *t_rules);
}
-/** Turn xlat_tokenize_argv() into an argv[] array, and nuke the input list.
+/** Turn am xlat list into an argv[] array, and nuke the input list.
*
* This is mostly for async use.
*/
-int xlat_flatten_compiled_argv(TALLOC_CTX *ctx, xlat_exp_head_t ***argv, xlat_exp_head_t *head)
+int xlat_flatten_to_argv(TALLOC_CTX *ctx, xlat_exp_head_t ***argv, xlat_exp_head_t *head)
{
int i;
xlat_exp_head_t **my_argv;
size_t count;
+ if (head->flags.needs_resolving) {
+ fr_strerror_printf("Cannot flatten expression with unresolved functions");
+ return -1;
+ }
+
count = 0;
xlat_exp_foreach(head, node) {
count++;
{
xlat_logical_inst_t *inst = talloc_get_type_abort(xctx->inst, xlat_logical_inst_t);
- inst->argc = xlat_flatten_compiled_argv(inst, &inst->argv, xctx->ex->call.args);
+ inst->argc = xlat_flatten_to_argv(inst, &inst->argv, xctx->ex->call.args);
if (xctx->ex->call.func->token == T_LOR) {
inst->callback = xlat_logical_or_resume;
inst->stop_on_match = true;