aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/regexp.c
diff options
context:
space:
mode:
authorMichael Schupikov <michael@schupikov.de>2017-09-23 09:56:44 +0200
committerJames McCoy <jamessan@jamessan.com>2017-12-15 15:50:58 -0500
commitd5bce42b524708a54243658e87b1e3bd9c7acdf3 (patch)
tree2707be6b36b8b5a920bfd73f1b60da011b7e1ced /src/nvim/regexp.c
parent6ff13d78b7eb0a1fae2e2e8cdd054072e1467158 (diff)
downloadrneovim-d5bce42b524708a54243658e87b1e3bd9c7acdf3.tar.gz
rneovim-d5bce42b524708a54243658e87b1e3bd9c7acdf3.tar.bz2
rneovim-d5bce42b524708a54243658e87b1e3bd9c7acdf3.zip
vim-patch:8.0.0074
Problem: Cannot make Vim fail on an internal error. Solution: Add IEMSG() and IEMSG2(). (Domenique Pelle) Avoid reporting an internal error without mentioning where. https://github.com/vim/vim/commit/95f096030ed1a8afea028f2ea295d6f6a70f466f Signed-off-by: Michael Schupikov <michael@schupikov.de>
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r--src/nvim/regexp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index ae611a0005..e921706b3a 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -459,14 +459,15 @@ static int toggle_Magic(int x)
/* Used for an error (down from) vim_regcomp(): give the error message, set
* rc_did_emsg and return NULL */
#define EMSG_RET_NULL(m) return (EMSG(m), rc_did_emsg = TRUE, (void *)NULL)
+#define IEMSG_RET_NULL(m) return (IEMSG(m), rc_did_emsg = true, (void *)NULL)
#define EMSG_RET_FAIL(m) return (EMSG(m), rc_did_emsg = TRUE, FAIL)
#define EMSG2_RET_NULL(m, \
c) return (EMSG2((m), \
- (c) ? "" : "\\"), rc_did_emsg = TRUE, \
+ (c) ? "" : "\\"), rc_did_emsg = true, \
(void *)NULL)
#define EMSG2_RET_FAIL(m, \
c) return (EMSG2((m), \
- (c) ? "" : "\\"), rc_did_emsg = TRUE, \
+ (c) ? "" : "\\"), rc_did_emsg = true, \
FAIL)
#define EMSG_ONE_RET_NULL EMSG2_RET_NULL(_( \
"E369: invalid item in %s%%[]"), reg_magic == MAGIC_ALL)
@@ -1891,8 +1892,8 @@ static char_u *regatom(int *flagp)
case Magic(')'):
if (one_exactly)
EMSG_ONE_RET_NULL;
- EMSG_RET_NULL(_(e_internal)); /* Supposed to be caught earlier. */
- /* NOTREACHED */
+ IEMSG_RET_NULL(_(e_internal)); // Supposed to be caught earlier.
+ // NOTREACHED
case Magic('='):
case Magic('?'):
@@ -4534,7 +4535,7 @@ regmatch (
brace_max[no] = OPERAND_MAX(scan);
brace_count[no] = 0;
} else {
- EMSG(_(e_internal)); /* Shouldn't happen */
+ internal_error("BRACE_LIMITS");
status = RA_FAIL;
}
}