0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

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.
This commit is contained in:
Bram Moolenaar
2016-11-10 20:01:45 +01:00
parent 459ca56312
commit 95f096030e
30 changed files with 159 additions and 91 deletions

View File

@@ -335,11 +335,13 @@ 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, (void *)NULL)
#define EMSG2_RET_FAIL(m, c) return (EMSG2((m), (c) ? "" : "\\"), rc_did_emsg = TRUE, FAIL)
#define EMSG_ONE_RET_NULL EMSG2_RET_NULL(_("E369: invalid item in %s%%[]"), reg_magic == MAGIC_ALL)
#define MAX_LIMIT (32767L << 16L)
static int re_multi_type(int);
@@ -2043,7 +2045,7 @@ regatom(int *flagp)
case Magic(')'):
if (one_exactly)
EMSG_ONE_RET_NULL;
EMSG_RET_NULL(_(e_internal)); /* Supposed to be caught earlier. */
IEMSG_RET_NULL(_(e_internal)); /* Supposed to be caught earlier. */
/* NOTREACHED */
case Magic('='):
@@ -5070,7 +5072,7 @@ regmatch(
}
else
{
EMSG(_(e_internal)); /* Shouldn't happen */
internal_error("BRACE_LIMITS");
status = RA_FAIL;
}
}