vim-patch:9.0.0386: some code blocks are nested too deep

Problem:    Some code blocks are nested too deep.
Solution:   Bail out earlier. (Yegappan Lakshmanan, closes vim/vim#11058)
b1f471ee20
This commit is contained in:
zeertzjq
2022-09-05 21:54:23 +08:00
parent a220650fd6
commit fc7a64291a
2 changed files with 100 additions and 87 deletions

View File

@@ -506,16 +506,18 @@ bool striequal(const char *a, const char *b)
// Did_outofmem_msg is reset when a character is read.
void do_outofmem_msg(size_t size)
{
if (!did_outofmem_msg) {
// Don't hide this message
emsg_silent = 0;
/* Must come first to avoid coming back here when printing the error
* message fails, e.g. when setting v:errmsg. */
did_outofmem_msg = true;
semsg(_("E342: Out of memory! (allocating %" PRIu64 " bytes)"), (uint64_t)size);
if (did_outofmem_msg) {
return;
}
// Don't hide this message
emsg_silent = 0;
// Must come first to avoid coming back here when printing the error
// message fails, e.g. when setting v:errmsg.
did_outofmem_msg = true;
semsg(_("E342: Out of memory! (allocating %" PRIu64 " bytes)"), (uint64_t)size);
}
/// Writes time_t to "buf[8]".