From: Arran Cudbard-Bell Date: Wed, 30 Apr 2025 20:24:30 +0000 (-0400) Subject: uflags don't unwind anything anymore X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42cc84af25331d5f61a61b9136f77cb0048c6481;p=thirdparty%2Ffreeradius-server.git uflags don't unwind anything anymore --- diff --git a/src/lib/unlang/interpret.c b/src/lib/unlang/interpret.c index 1418eebafa..53a854c368 100644 --- a/src/lib/unlang/interpret.c +++ b/src/lib/unlang/interpret.c @@ -176,7 +176,7 @@ int unlang_interpret_push(request_t *request, unlang_t const *instruction, } /* else frame->next MUST be NULL */ - frame->uflags = UNWIND_FRAME_FLAG_NONE; + frame->flag = UNLANG_FRAME_FLAG_NONE; if (top_frame) top_frame_set(frame); frame->result = default_rcode; diff --git a/src/lib/unlang/unlang_priv.h b/src/lib/unlang/unlang_priv.h index 3a2937ab40..5f8f28ff6c 100644 --- a/src/lib/unlang/unlang_priv.h +++ b/src/lib/unlang/unlang_priv.h @@ -97,14 +97,14 @@ typedef enum { DIAG_OFF(attributes) typedef enum CC_HINT(flag_enum) { - UNWIND_FRAME_FLAG_NONE = 0x00, //!< No flags. - UNWIND_FRAME_FLAG_REPEAT = 0x01, //!< Repeat the frame on the way up the stack. - UNWIND_FRAME_FLAG_TOP_FRAME = 0x02, //!< are we the top frame of the stack? + UNLANG_FRAME_FLAG_NONE = 0x00, //!< No flags. + UNLANG_FRAME_FLAG_REPEAT = 0x01, //!< Repeat the frame on the way up the stack. + UNLANG_FRAME_FLAG_TOP_FRAME = 0x02, //!< are we the top frame of the stack? ///< If true, causes the interpreter to stop ///< interpreting and return, control then passes ///< to whatever called the interpreter. - UNWIND_FRAME_FLAG_YIELDED = 0x04, //!< frame has yielded - UNWIND_FRAME_FLAG_CANCEL = 0x08, //!< This frame has been marked up for cancellation. + UNLANG_FRAME_FLAG_YIELDED = 0x04, //!< frame has yielded + UNLANG_FRAME_FLAG_CANCEL = 0x08, //!< This frame has been marked up for cancellation. } unlang_frame_flag_t; DIAG_ON(attributes) @@ -322,7 +322,7 @@ struct unlang_stack_frame_s { rindent_t indent; //!< Indent level of the request when the frame was ///< created. This is used to restore the indent ///< level when the stack is being forcefully unwound. - unlang_frame_flag_t uflags; //!< Unwind flags + unlang_frame_flag_t flag; //!< Unwind flags #ifdef WITH_PERF fr_time_tracking_t tracking; //!< track this instance of this instruction @@ -352,20 +352,20 @@ extern unlang_op_t unlang_ops[]; extern fr_table_num_sorted_t const mod_rcode_table[]; extern size_t mod_rcode_table_len; -static inline void repeatable_set(unlang_stack_frame_t *frame) { frame->uflags |= UNWIND_FRAME_FLAG_REPEAT; } -static inline void top_frame_set(unlang_stack_frame_t *frame) { frame->uflags |= UNWIND_FRAME_FLAG_TOP_FRAME; } -static inline void yielded_set(unlang_stack_frame_t *frame) { frame->uflags |= UNWIND_FRAME_FLAG_YIELDED; } -static inline void cancel_set(unlang_stack_frame_t *frame) { frame->uflags |= UNWIND_FRAME_FLAG_CANCEL; } +static inline void repeatable_set(unlang_stack_frame_t *frame) { frame->flag |= UNLANG_FRAME_FLAG_REPEAT; } +static inline void top_frame_set(unlang_stack_frame_t *frame) { frame->flag |= UNLANG_FRAME_FLAG_TOP_FRAME; } +static inline void yielded_set(unlang_stack_frame_t *frame) { frame->flag |= UNLANG_FRAME_FLAG_YIELDED; } +static inline void cancel_set(unlang_stack_frame_t *frame) { frame->flag |= UNLANG_FRAME_FLAG_CANCEL; } -static inline void repeatable_clear(unlang_stack_frame_t *frame) { frame->uflags &= ~UNWIND_FRAME_FLAG_REPEAT; } -static inline void top_frame_clear(unlang_stack_frame_t *frame) { frame->uflags &= ~UNWIND_FRAME_FLAG_TOP_FRAME; } -static inline void yielded_clear(unlang_stack_frame_t *frame) { frame->uflags &= ~UNWIND_FRAME_FLAG_YIELDED; } -static inline void cancel_clear(unlang_stack_frame_t *frame) { frame->uflags &= ~UNWIND_FRAME_FLAG_CANCEL; } +static inline void repeatable_clear(unlang_stack_frame_t *frame) { frame->flag &= ~UNLANG_FRAME_FLAG_REPEAT; } +static inline void top_frame_clear(unlang_stack_frame_t *frame) { frame->flag &= ~UNLANG_FRAME_FLAG_TOP_FRAME; } +static inline void yielded_clear(unlang_stack_frame_t *frame) { frame->flag &= ~UNLANG_FRAME_FLAG_YIELDED; } +static inline void cancel_clear(unlang_stack_frame_t *frame) { frame->flag &= ~UNLANG_FRAME_FLAG_CANCEL; } -static inline bool is_repeatable(unlang_stack_frame_t const *frame) { return frame->uflags & UNWIND_FRAME_FLAG_REPEAT; } -static inline bool is_top_frame(unlang_stack_frame_t const *frame) { return frame->uflags & UNWIND_FRAME_FLAG_TOP_FRAME; } -static inline bool is_yielded(unlang_stack_frame_t const *frame) { return frame->uflags & UNWIND_FRAME_FLAG_YIELDED; } -static inline bool is_cancelled(unlang_stack_frame_t const *frame) { return frame->uflags & UNWIND_FRAME_FLAG_CANCEL; } +static inline bool is_repeatable(unlang_stack_frame_t const *frame) { return frame->flag & UNLANG_FRAME_FLAG_REPEAT; } +static inline bool is_top_frame(unlang_stack_frame_t const *frame) { return frame->flag & UNLANG_FRAME_FLAG_TOP_FRAME; } +static inline bool is_yielded(unlang_stack_frame_t const *frame) { return frame->flag & UNLANG_FRAME_FLAG_YIELDED; } +static inline bool is_cancelled(unlang_stack_frame_t const *frame) { return frame->flag & UNLANG_FRAME_FLAG_CANCEL; } static inline bool _instruction_has_debug_braces(unlang_t const *instruction) { return unlang_ops[instruction->type].flag & UNLANG_OP_FLAG_DEBUG_BRACES; } static inline bool _frame_has_debug_braces(unlang_stack_frame_t const *frame) { return unlang_ops[frame->instruction->type].flag & UNLANG_OP_FLAG_DEBUG_BRACES; } @@ -393,7 +393,7 @@ static inline unsigned int unlang_frame_by_flag(unlang_stack_t *stack, unlang_fr for (i = stack->depth; i > 0; i--) { unlang_stack_frame_t *frame = &stack->frame[i]; - if (frame->uflags & flag) return i; + if (frame->flag & flag) return i; } return 0; } @@ -434,7 +434,7 @@ static inline unlang_action_t unwind_to_depth(unlang_stack_t *stack, unsigned in for (i = depth; i >= to_depth; i--) { frame = &stack->frame[i]; - frame->uflags |= UNWIND_FRAME_FLAG_CANCEL; + frame->flag |= UNLANG_FRAME_FLAG_CANCEL; } return UNLANG_ACTION_CALCULATE_RESULT; @@ -559,7 +559,7 @@ static inline void frame_cleanup(unlang_stack_frame_t *frame) /* * Don't clear top_frame flag, bad things happen... */ - frame->uflags &= UNWIND_FRAME_FLAG_TOP_FRAME; + frame->flag &= UNLANG_FRAME_FLAG_TOP_FRAME; if (frame->state) { talloc_free_children(frame->state); /* *(ev->parent) = NULL in event.c */ TALLOC_FREE(frame->state);