static unlang_action_t unlang_foreach(REQUEST *request, rlm_rcode_t *presult)
{
unlang_stack_t *stack = request->stack;
- unlang_stack_frame_t *frame = &stack->frame[stack->depth];
+ unlang_stack_frame_t *frame;
unlang_t *instruction = frame->instruction;
unlang_frame_state_foreach_t *foreach = NULL;
unlang_group_t *g;
g = unlang_generic_to_group(instruction);
- /*
- * Ensure any breaks terminate here...
- */
- break_point_set(frame);
-
if (stack->depth >= UNLANG_STACK_MAX) {
ERROR("Internal sanity check failed: module stack is too deep");
fr_exit(EXIT_FAILURE);
}
+ frame = &stack->frame[stack->depth];
+
+ /*
+ * Ensure any breaks terminate here...
+ */
+ break_point_set(frame);
+
/*
* Figure out foreach depth by walking back up the stack
*/