vim-patch:8.2.4399: crash after ml_get error

Problem:    Crash after ml_get error.
Solution:   When returning "???" flush the line and set ml_line_lnum.
https://github.com/vim/vim/commit/f9435e49ef8032e80d38e31e950e4a9b75387533
This commit is contained in:
zeertzjq
2022-07-07 08:10:53 +08:00
parent 4bb01262ca
commit 8ce60ddd07
+3
View File
@@ -1844,8 +1844,11 @@ char_u *ml_get_buf(buf_T *buf, linenr_T lnum, bool will_change)
siemsg(_("E315: ml_get: invalid lnum: %" PRId64), (int64_t)lnum);
recursive--;
}
ml_flush_line(buf);
buf->b_ml.ml_flags &= ~ML_LINE_DIRTY;
errorret:
STRCPY(questions, "???");
buf->b_ml.ml_line_lnum = lnum;
return questions;
}
if (lnum <= 0) { // pretend line 0 is line 1