]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add assertions to make intent clear
authorAlan T. DeKok <aland@freeradius.org>
Tue, 3 Sep 2024 15:24:59 +0000 (11:24 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 3 Sep 2024 19:05:24 +0000 (15:05 -0400)
which doesn't change anything, but does help us track the
migration away from '&'

src/lib/unlang/xlat_expr.c

index c6a03689614c9c8ba9472525a58fe01b7b970f0f..bcf574e1cc8993765c2bfe46390af3cc2e3169e2 100644 (file)
@@ -2670,6 +2670,17 @@ static fr_slen_t tokenize_field(xlat_exp_head_t *head, xlat_exp_t **out, fr_sbuf
        } else if (tmpl_contains_xlat(node->vpt)) {
                node->flags = tmpl_xlat(vpt)->flags;
 
+       } else if (tmpl_is_attr(node->vpt)) {
+               node->flags.pure = false;
+
+#ifndef NDEBUG
+               if (vpt->name[0] == '%') {
+                       fr_assert(vpt->rules.attr.prefix == TMPL_ATTR_REF_PREFIX_NO);
+               } else {
+                       fr_assert(vpt->rules.attr.prefix == TMPL_ATTR_REF_PREFIX_YES);
+               }
+#endif
+
        } else {
                node->flags.pure = false;
        }