]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libiberty/regex.c
Daily bump.
[thirdparty/gcc.git] / libiberty / regex.c
index 9ffc3f47f006d89b7c046b704e7ac6cc0ae78d80..67747e6ce5a1ccf41f65cf3bc9a5782161678bdf 100644 (file)
@@ -3,8 +3,7 @@
    (Implements POSIX draft P1003.2/D11.2, except for some of the
    internationalization features.)
 
-   Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-   2002, 2005, 2010, 2013 Free Software Foundation, Inc.
+   Copyright (C) 1993-2024 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
   #pragma alloca
 #endif
 
+#if __GNUC__ >= 12
+#  pragma GCC diagnostic ignored "-Wuse-after-free"
+#endif
+
 #undef _GNU_SOURCE
 #define _GNU_SOURCE
 
@@ -2493,6 +2496,7 @@ PREFIX(regex_compile) (const char *ARG_PREFIX(pattern),
           if ((syntax & RE_BK_PLUS_QM)
               || (syntax & RE_LIMITED_OPS))
             goto normal_char;
+         /* Fall through.  */
         handle_plus:
         case '*':
           /* If there is no previous pattern... */
@@ -5593,7 +5597,7 @@ byte_re_match_2_internal (struct re_pattern_buffer *bufp,
      to resume scanning the pattern; the second one is where to resume
      scanning the strings.  If the latter is zero, the failure point is
      a ``dummy''; if a failure happens and the failure point is a dummy,
-     it gets discarded and the next next one is tried.  */
+     it gets discarded and the next one is tried.  */
 #ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global.  */
   PREFIX(fail_stack_type) fail_stack;
 #endif
@@ -6697,6 +6701,7 @@ byte_re_match_2_internal (struct re_pattern_buffer *bufp,
                 {
                   case jump_n:
                    is_a_jump_n = true;
+                   /* Fall through.  */
                   case pop_failure_jump:
                  case maybe_pop_jump:
                  case jump:
@@ -7125,7 +7130,7 @@ byte_re_match_2_internal (struct re_pattern_buffer *bufp,
               DEBUG_PRINT1 ("  Match => jump.\n");
              goto unconditional_jump;
            }
-        /* Note fall through.  */
+        /* Fall through.  */
 
 
        /* The end of a simple repeat has a pop_failure_jump back to
@@ -7150,7 +7155,7 @@ byte_re_match_2_internal (struct re_pattern_buffer *bufp,
                                dummy_low_reg, dummy_high_reg,
                                reg_dummy, reg_dummy, reg_info_dummy);
           }
-         /* Note fall through.  */
+         /* Fall through.  */
 
        unconditional_jump:
 #ifdef _LIBC
@@ -7453,6 +7458,7 @@ byte_re_match_2_internal (struct re_pattern_buffer *bufp,
                 {
                 case jump_n:
                   is_a_jump_n = true;
+                 /* Fall through.  */
                 case maybe_pop_jump:
                 case pop_failure_jump:
                 case jump:
@@ -7718,6 +7724,7 @@ PREFIX(common_op_match_null_string_p) (UCHAR_T **p, UCHAR_T *end,
 
     case set_number_at:
       p1 += 2 * OFFSET_ADDRESS_SIZE;
+      return false;
 
     default:
       /* All other opcodes mean we cannot match the empty string.  */