summaryrefslogtreecommitdiff
path: root/gl/lib/regcomp.c.diff
blob: 88097a445308a7b6a7388ac79415ee6742e796b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
diff --git a/lib/regcomp.c b/lib/regcomp.c
index 6472ff6..fadf36d 100644
--- a/lib/regcomp.c
+++ b/lib/regcomp.c
@@ -18,6 +18,8 @@
    with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */

+#include "intprops.h"
+#include "verify.h"
 static reg_errcode_t re_compile_internal (regex_t *preg, const char * pattern,
 					  size_t length, reg_syntax_t syntax);
 static void re_compile_fastmap_iter (regex_t *bufp,
@@ -2571,7 +2573,8 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
   /* This loop is actually executed only when end != REG_MISSING,
      to rewrite <re>{0,n} as (<re>(<re>...<re>?)?)?...  We have
      already created the start+1-th copy.  */
-  if ((Idx) -1 < 0 || end != REG_MISSING)
+  verify (! TYPE_SIGNED (Idx));
+  if (end != REG_MISSING)
     for (i = start + 2; i <= end; ++i)
       {
 	elem = duplicate_tree (elem, dfa);