]> Savannah Git Hosting - gnulib.git/commitdiff
regex: tell compiler there’s at most 256 arcs out
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 Oct 2019 00:37:37 +0000 (17:37 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 Oct 2019 01:34:05 +0000 (18:34 -0700)
Partly this is to help the reader (and maybe help GCC);
partly this is to pacify Coverity.
* lib/regex_internal.h: Include verify.h.
* lib/regexec.c (group_nodes_into_DFAstates):
Tell the compiler that ndests cannot exceed SBC_MAX.
* modules/regex (Depends-on): Add ‘verify’.

ChangeLog
lib/regex_internal.h
lib/regexec.c
modules/regex

index 4f96c8cbff987bc18305e84923efae30f401efc5..360973ba46765c9d54f50700f444fd592f3bf2cf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2019-10-09  Paul Eggert  <eggert@cs.ucla.edu>
 
+       regex: tell compiler there’s at most 256 arcs out
+       Partly this is to help the reader (and maybe help GCC);
+       partly this is to pacify Coverity.
+       * lib/regex_internal.h: Include verify.h.
+       * lib/regexec.c (group_nodes_into_DFAstates):
+       Tell the compiler that ndests cannot exceed SBC_MAX.
+       * modules/regex (Depends-on): Add ‘verify’.
+
        regex: simplify by assuming C99
        * config/srclist.txt: Comment out regex_internal.h and regexec.c
        temporarily.
index 9c0e1f1d17ea64281248201d41accce20c3e1450..b6eeba32d5a910299862770ddbb05a42c70ea0dd 100644 (file)
@@ -34,6 +34,7 @@
 #include <stdint.h>
 
 #include <intprops.h>
+#include <verify.h>
 
 #ifdef _LIBC
 # include <libc-lock.h>
index f7d2b5b20dfcc069f4cf5977be6561cc34494107..0d32e0139f6d4d452aa813070d8369d1a2db4bc2 100644 (file)
@@ -3684,6 +3684,7 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
          bitset_empty (accepts);
        }
     }
+  assume (ndests <= SBC_MAX);
   return ndests;
  error_return:
   for (j = 0; j < ndests; ++j)
index 7f50916ce31ccdbc726892a0de9b062142a92df7..dbfd379820ae197a8ad90d6af75767d7cf10c120 100644 (file)
@@ -30,6 +30,7 @@ mbsinit         [test $ac_use_included_regex = yes]
 nl_langinfo     [test $ac_use_included_regex = yes]
 stdbool         [test $ac_use_included_regex = yes]
 stdint          [test $ac_use_included_regex = yes]
+verify          [test $ac_use_included_regex = yes]
 wchar           [test $ac_use_included_regex = yes]
 wcrtomb         [test $ac_use_included_regex = yes]
 wctype-h        [test $ac_use_included_regex = yes]