mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
vim-patch:9.0.0227: cannot read error message when abort() is called
Problem: Cannot read error message when abort() is called.
Solution: Output a newline before calling abort().
213e70e284
Add emsg_not_now() check to make code equivalent.
This commit is contained in:
@@ -837,6 +837,8 @@ void iemsg(const char *s)
|
|||||||
emsg(s);
|
emsg(s);
|
||||||
#ifdef ABORT_ON_INTERNAL_ERROR
|
#ifdef ABORT_ON_INTERNAL_ERROR
|
||||||
set_vim_var_string(VV_ERRMSG, s, -1);
|
set_vim_var_string(VV_ERRMSG, s, -1);
|
||||||
|
msg_putchar('\n'); // avoid overwriting the error message
|
||||||
|
ui_flush();
|
||||||
abort();
|
abort();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -846,11 +848,17 @@ void iemsg(const char *s)
|
|||||||
/// detected when fuzzing vim.
|
/// detected when fuzzing vim.
|
||||||
void siemsg(const char *s, ...)
|
void siemsg(const char *s, ...)
|
||||||
{
|
{
|
||||||
|
if (emsg_not_now()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, s);
|
va_start(ap, s);
|
||||||
(void)semsgv(s, ap);
|
(void)semsgv(s, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
#ifdef ABORT_ON_INTERNAL_ERROR
|
#ifdef ABORT_ON_INTERNAL_ERROR
|
||||||
|
msg_putchar('\n'); // avoid overwriting the error message
|
||||||
|
ui_flush();
|
||||||
abort();
|
abort();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user