From: Arran Cudbard-Bell Date: Tue, 29 Apr 2025 23:08:14 +0000 (-0400) Subject: Move unwind frame flags into an enum X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=925a36b49a02bea3b576408b72fdb2b555b23ec1;p=thirdparty%2Ffreeradius-server.git Move unwind frame flags into an enum --- diff --git a/src/lib/unlang/unlang_priv.h b/src/lib/unlang/unlang_priv.h index 01e9f4c0eb..1e8f345d27 100644 --- a/src/lib/unlang/unlang_priv.h +++ b/src/lib/unlang/unlang_priv.h @@ -95,6 +95,19 @@ typedef enum { #define UNLANG_DETACHABLE (true) #define UNLANG_NORMAL_CHILD (false) +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? + ///< 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_t; +DIAG_ON(attributes) + typedef struct unlang_s unlang_t; typedef struct unlang_stack_frame_s unlang_stack_frame_t; @@ -305,8 +318,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. - uint8_t uflags; //!< Unwind markers - + unlang_frame_flag_t uflags; //!< Unwind flags #ifdef WITH_PERF fr_time_tracking_t tracking; //!< track this instance of this instruction @@ -336,16 +348,6 @@ extern unlang_op_t unlang_ops[]; extern fr_table_num_sorted_t const mod_rcode_table[]; extern size_t mod_rcode_table_len; -#define UNWIND_FRAME_FLAG_NONE 0x00 //!< No flags. -#define UNWIND_FRAME_FLAG_REPEAT 0x01 //!< Repeat the frame on the way up the stack. -#define UNWIND_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. -#define UNWIND_FRAME_FLAG_BREAK_POINT 0x04 //!< 'break' stops here. -#define UNWIND_FRAME_FLAG_RETURN_POINT 0x08 //!< 'return' stops here. -#define UNWIND_FRAME_FLAG_NO_CLEAR 0x10 //!< Keep unwinding, don't clear the unwind flag. -#define UNWIND_FRAME_FLAG_YIELDED 0x20 //!< frame has yielded 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; } diff --git a/src/tests/keywords/timeout-catch b/src/tests/keywords/timeout-catch deleted file mode 100644 index d08523295c..0000000000 --- a/src/tests/keywords/timeout-catch +++ /dev/null @@ -1,13 +0,0 @@ -# -# PRE: timeout -# - -# -# @todo - we have to add a leading '0' here, otherwise cf_file.c complains -# -timeout 0.1s { - delay_10s -} -catch timeout { - success -}