aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKunMing Xie <qqzz014@gmail.com>2017-08-10 10:20:55 +0800
committerJustin M. Keyes <justinkz@gmail.com>2017-08-10 04:20:55 +0200
commitb7e84de7d2385670aadcea9c02bc68206db98862 (patch)
tree8316347eba0d3bcd03055bfd11a63e3c33a1ceb9
parentde1084f3c48816e96be3cac28bcf56bd321ad800 (diff)
downloadrneovim-b7e84de7d2385670aadcea9c02bc68206db98862.tar.gz
rneovim-b7e84de7d2385670aadcea9c02bc68206db98862.tar.bz2
rneovim-b7e84de7d2385670aadcea9c02bc68206db98862.zip
vim-patch:8.0.0165 (#7132)
Problem: Ubsan warns for integer overflow. Solution: Swap two conditions. (Dominique Pelle) https://github.com/vim/vim/commit/f446b48ff0bffae2b453cd4f9e3c25dfe363d29d
-rw-r--r--src/nvim/regexp_nfa.c16
-rw-r--r--src/nvim/version.c2
2 files changed, 9 insertions, 9 deletions
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c
index 5d708febea..93ba9ce097 100644
--- a/src/nvim/regexp_nfa.c
+++ b/src/nvim/regexp_nfa.c
@@ -56,13 +56,13 @@ enum {
NFA_RANGE_MIN, /* low end of a range */
NFA_RANGE_MAX, /* high end of a range */
- NFA_CONCAT, /* concatenate two previous items (postfix
- * only) */
- NFA_OR, /* \| (postfix only) */
- NFA_STAR, /* greedy * (posfix only) */
- NFA_STAR_NONGREEDY, /* non-greedy * (postfix only) */
- NFA_QUEST, /* greedy \? (postfix only) */
- NFA_QUEST_NONGREEDY, /* non-greedy \? (postfix only) */
+ NFA_CONCAT, // concatenate two previous items (postfix
+ // only)
+ NFA_OR, // \| (postfix 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)
NFA_BOL, /* ^ Begin line */
NFA_EOL, /* $ End line */
@@ -1988,7 +1988,7 @@ static int nfa_regpiece(void)
// The engine is very inefficient (uses too many states) when the 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)) {
+ if ((nfa_re_flags & RE_AUTO) && (maxval > 500 || maxval > minval + 200)) {
return FAIL;
}
diff --git a/src/nvim/version.c b/src/nvim/version.c
index fa179b4f63..72af7dbafd 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -787,7 +787,7 @@ static const int included_patches[] = {
168,
167,
// 166,
- // 165,
+ 165,
// 164,
// 163 NA
// 162 NA