@@ -94,6 +94,10 @@ void _xlat_exp_set_type(NDEBUG_LOCATION_ARGS xlat_exp_t *node, xlat_type_t type)
9494 node -> call .args = _xlat_exp_head_alloc (NDEBUG_LOCATION_VALS node );
9595 break ;
9696
97+ case XLAT_BOX :
98+ node -> flags .constant = node -> flags .pure = node -> flags .can_purify = true;
99+ break ;
100+
97101 default :
98102 break ;
99103 }
@@ -167,6 +171,10 @@ xlat_exp_t *_xlat_exp_alloc(NDEBUG_LOCATION_ARGS TALLOC_CTX *ctx, xlat_type_t ty
167171 inlen + extra );
168172 _xlat_exp_set_type (NDEBUG_LOCATION_VALS node , type );
169173
174+ if (type == XLAT_BOX ) {
175+ node -> flags .constant = node -> flags .pure = node -> flags .can_purify = true;
176+ }
177+
170178 if (!in ) return node ;
171179
172180 node -> fmt = talloc_bstrndup (node , in , inlen );
@@ -339,6 +347,16 @@ void xlat_exp_verify(xlat_exp_t const *node)
339347 return ;
340348
341349 case XLAT_FUNC :
350+ xlat_exp_foreach (node -> call .args , arg ) {
351+ fr_assert (arg -> type == XLAT_GROUP );
352+
353+ /*
354+ * We can't do this yet, because the old function argument parser doesn't do the
355+ * right thing.
356+ */
357+ // fr_assert(arg->quote == T_BARE_WORD);
358+ }
359+
342360 xlat_exp_head_verify (node -> call .args );
343361 (void )talloc_get_type_abort_const (node -> fmt , char );
344362 return ;
@@ -400,6 +418,12 @@ void xlat_exp_verify(xlat_exp_t const *node)
400418 return ;
401419 }
402420
421+ case XLAT_BOX :
422+ fr_assert (node -> flags .constant );
423+ fr_assert (node -> flags .pure );
424+ // fr_assert(node->flags.can_purify);
425+ break ;
426+
403427 default :
404428 break ;
405429 }
0 commit comments