From: Alan T. DeKok Date: Fri, 30 Jun 2017 15:48:00 +0000 (-0400) Subject: assert that modules don't break indentation X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c563d52a6dd6e5f01ef2d4201d1a4dc3ea7dc58;p=thirdparty%2Ffreeradius-server.git assert that modules don't break indentation --- diff --git a/src/main/unlang_interpret.c b/src/main/unlang_interpret.c index bd6f130b50c..21e4e1e15bb 100644 --- a/src/main/unlang_interpret.c +++ b/src/main/unlang_interpret.c @@ -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];