]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
walk function arguments first.
authorAlan T. DeKok <aland@freeradius.org>
Wed, 8 Jun 2022 13:26:12 +0000 (09:26 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 17 Jun 2022 12:39:01 +0000 (08:39 -0400)
because the instantiation function can move the arguments into
it's private data structure

src/lib/unlang/xlat_eval.c

index 36477d1c642d4335e079c97a98d1238cde88a29b..e3ef3aa347eb97a7e640a3958fe99bb80e840380 100644 (file)
@@ -1818,18 +1818,15 @@ int xlat_eval_walk(xlat_exp_head_t *head, xlat_walker_t walker, xlat_type_t type
                        break;
 
                case XLAT_FUNC_UNRESOLVED:
-                       if (!type || (type & XLAT_FUNC_UNRESOLVED)) {
-                               ret = walker(node, uctx);
+                       if (xlat_exp_head(node->call.args)) {
+                               ret = xlat_eval_walk(node->call.args, walker, type, uctx);
                                if (ret < 0) return ret;
-                               if (ret > 0) return 0;
                        }
 
-                       /*
-                        *      Now evaluate the function's arguments
-                        */
-                       if (xlat_exp_head(node->call.args)) {
-                               ret = xlat_eval_walk(node->call.args, walker, type, uctx);
+                       if (!type || (type & XLAT_FUNC_UNRESOLVED)) {
+                               ret = walker(node, uctx);
                                if (ret < 0) return ret;
+                               if (ret > 0) return 0;
                        }
                        break;