]> granicus.if.org Git - vim/commitdiff
patch 8.0.0165: ubsan warns for integer overflow v8.0.0165
authorBram Moolenaar <Bram@vim.org>
Tue, 10 Jan 2017 12:55:14 +0000 (13:55 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 10 Jan 2017 12:55:14 +0000 (13:55 +0100)
Problem:    Ubsan warns for integer overflow.
Solution:   Swap two conditions. (Dominique Pelle)

src/regexp_nfa.c
src/version.c

index 919dadcb0cb0375610e999b1c6a6b0e76ec2be03..de22dcbacc16d35a805ea9e04895c701a79e17ab 100644 (file)
@@ -50,7 +50,7 @@ enum
     NFA_CONCAT,                            /* concatenate two previous items (postfix
                                     * only) */
     NFA_OR,                        /* \| (postfix only) */
-    NFA_STAR,                      /* greedy * (posfix only) */
+    NFA_STAR,                      /* greedy * (postfix only) */
     NFA_STAR_NONGREEDY,                    /* non-greedy * (postfix only) */
     NFA_QUEST,                     /* greedy \? (postfix only) */
     NFA_QUEST_NONGREEDY,           /* non-greedy \? (postfix only) */
@@ -2169,7 +2169,7 @@ nfa_regpiece(void)
             * maximum is much larger than the minimum and when the maximum is
             * large.  Bail out if we can use the other engine. */
            if ((nfa_re_flags & RE_AUTO)
-                                  && (maxval > minval + 200 || maxval > 500))
+                                  && (maxval > 500 || maxval > minval + 200))
                return FAIL;
 
            /* Ignore previous call to nfa_regatom() */
index 36143206a5683d41bb2191f6514384430d07591b..b5039a01d8644ee4a9b873b50986cc7f6a318ea4 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    165,
 /**/
     164,
 /**/