]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
assert that modules don't break indentation
authorAlan T. DeKok <aland@freeradius.org>
Fri, 30 Jun 2017 15:48:00 +0000 (11:48 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 30 Jun 2017 15:48:00 +0000 (11:48 -0400)
src/main/unlang_interpret.c

index bd6f130b50c11129d009cee261bab450c094a20f..21e4e1e15bbdaef0c69ca5c5b2e38ac2ed4bb324 100644 (file)
@@ -953,6 +953,10 @@ static unlang_action_t unlang_module_call(REQUEST *request, unlang_stack_t *stac
        unlang_t                        *instruction = frame->instruction;
        unlang_stack_state_modcall_t    *modcall_state;
 
+#ifndef NDEBUG
+       int unlang_indent               = request->log.unlang_indent;
+#endif
+
        /*
         *      Process a stand-alone child, and fall through
         *      to dealing with it's parent.
@@ -1011,6 +1015,8 @@ static unlang_action_t unlang_module_call(REQUEST *request, unlang_stack_t *stac
        if (*presult == RLM_MODULE_YIELD) {
                modcall_state->thread->active_callers++;
        } else {
+               rad_assert(unlang_indent == request->log.unlang_indent);
+
                rad_assert(*presult >= RLM_MODULE_REJECT);
                rad_assert(*presult < RLM_MODULE_NUMCODES);
                *priority = instruction->actions[*presult];