From 8cdf58d12482ff4b5bf059c3f0dc9de2844b1b50 Mon Sep 17 00:00:00 2001 From: yukangzhi Date: Tue, 21 Jan 2025 12:20:08 +0800 Subject: [PATCH] libs/libc/regex: remove logically dead code in regcomp.c This change removes redundant and unreachable checks of `status != REG_OK` that were reported by static code scanning. Two occurrences were fixed in `libs/libc/regex/regcomp.c` Signed-off-by: yukangzhi --- libs/libc/regex/regcomp.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/libs/libc/regex/regcomp.c b/libs/libc/regex/regcomp.c index 748ca7f10ee..37ac6c2135d 100644 --- a/libs/libc/regex/regcomp.c +++ b/libs/libc/regex/regcomp.c @@ -2290,10 +2290,6 @@ static reg_errcode_t tre_copy_ast(tre_mem_t mem, tre_stack_t *stack, while (status == REG_OK && tre_stack_num_objects(stack) > bottom) { tre_ast_node_t *node; - if (status != REG_OK) - { - break; - } symbol = (tre_copyast_symbol_t)tre_stack_pop_int(stack); switch (symbol) @@ -2463,11 +2459,6 @@ static reg_errcode_t tre_expand_ast(tre_mem_t mem, tre_stack_t *stack, tre_ast_node_t *node; tre_expand_ast_symbol_t symbol; - if (status != REG_OK) - { - break; - } - symbol = (tre_expand_ast_symbol_t)tre_stack_pop_int(stack); node = tre_stack_pop_voidptr(stack); switch (symbol)