diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-03-01 02:32:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-01 02:32:13 +0100 |
commit | 085f0f1b1b4e03d5378ca37ae2cb8670a7fa53cd (patch) | |
tree | f479fb2d53d16ce5779354c13467fa158759d730 /src/nvim/regexp_nfa.c | |
parent | e7bd49d835e26c96b2ee152e5b697e20ab749650 (diff) | |
parent | e116b0f61f87a79fd93beb32c337f5bd9e2d3ab9 (diff) | |
download | rneovim-085f0f1b1b4e03d5378ca37ae2cb8670a7fa53cd.tar.gz rneovim-085f0f1b1b4e03d5378ca37ae2cb8670a7fa53cd.tar.bz2 rneovim-085f0f1b1b4e03d5378ca37ae2cb8670a7fa53cd.zip |
Merge #9653 from justinmk/vim-8.1.0985
Diffstat (limited to 'src/nvim/regexp_nfa.c')
-rw-r--r-- | src/nvim/regexp_nfa.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/nvim/regexp_nfa.c b/src/nvim/regexp_nfa.c index d34e653058..95030974d8 100644 --- a/src/nvim/regexp_nfa.c +++ b/src/nvim/regexp_nfa.c @@ -1420,12 +1420,12 @@ static int nfa_regatom(void) default: nr = -1; break; } - if (nr < 0) - EMSG2_RET_FAIL( - _("E678: Invalid character after %s%%[dxouU]"), - reg_magic == MAGIC_ALL); - /* A NUL is stored in the text as NL */ - /* TODO: what if a composing character follows? */ + if (nr < 0 || nr > INT_MAX) { + EMSG2_RET_FAIL(_("E678: Invalid character after %s%%[dxouU]"), + reg_magic == MAGIC_ALL); + } + // A NUL is stored in the text as NL + // TODO(vim): what if a composing character follows? EMIT(nr == 0 ? 0x0a : nr); } break; @@ -6476,16 +6476,10 @@ static regprog_T *nfa_regcomp(char_u *expr, int re_flags) nfa_regcomp_start(expr, re_flags); - /* Build postfix form of the regexp. Needed to build the NFA - * (and count its size). */ + // Build postfix form of the regexp. Needed to build the NFA + // (and count its size). postfix = re2post(); if (postfix == NULL) { - // TODO(vim): only give this error for debugging? - if (post_ptr >= post_end) { - IEMSGN("Internal error: estimated max number " - "of states insufficient: %" PRId64, - post_end - post_start); - } goto fail; // Cascaded (syntax?) error } |