]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Revert "We don't need to clear repeatable anymore it's done by frame_cleanup"
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 10 Sep 2019 15:06:27 +0000 (10:06 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 10 Sep 2019 15:16:08 +0000 (10:16 -0500)
This reverts commit bbc8a8bfe272095cc186d1313b98438d19c65d7b.

src/lib/unlang/interpret.c

index 3102ea09923eba01b10ed18173ae173812ad33db..3a2e46e6709c516a757542b68c5667d0dcf5e22a 100644 (file)
@@ -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