From: Arran Cudbard-Bell Date: Tue, 10 Sep 2019 15:06:27 +0000 (-0500) Subject: Revert "We don't need to clear repeatable anymore it's done by frame_cleanup" X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9e388a391ffde278a5bdc7518cda8a6c15ef5deb;p=thirdparty%2Ffreeradius-server.git Revert "We don't need to clear repeatable anymore it's done by frame_cleanup" This reverts commit bbc8a8bfe272095cc186d1313b98438d19c65d7b. --- diff --git a/src/lib/unlang/interpret.c b/src/lib/unlang/interpret.c index 3102ea09923..3a2e46e6709 100644 --- a/src/lib/unlang/interpret.c +++ b/src/lib/unlang/interpret.c @@ -428,6 +428,22 @@ static inline void frame_pop(unlang_stack_t *stack) frame_cleanup(frame); frame = &stack->frame[--stack->depth]; + + /* + * The child was break / return, AND the current frame is + * a break / return point. Stop unwinding the stack. + * + * NOTE: This is the frame further UP the stack, not the + * one we just popped. So we *MUST* clear repeat, + * otherwise the interpreter will just keep repeating + * this frame instead of continuing to unwind the stack. + * + * An alternative way of doing this would be to rearrange + * the code so repeat unwinding had precedence, but it's + * probably more robust to have the interpreter not be + * dependent on flag evaluation order. + */ + if (stack->unwind && is_repeatable(frame)) repeatable_clear(frame); } /** Evaluates all the unlang nodes in a section