0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.4762: using freed memory using synstack() and synID() in WinEnter

Problem:    Using freed memory when using synstack() and synID() in WinEnter.
Solution:   Check using the syntax window. (closes #10204)
This commit is contained in:
zeertzjq
2022-04-16 16:49:24 +01:00
committed by Bram Moolenaar
parent e0805b849c
commit ca7e86c237
3 changed files with 18 additions and 2 deletions

View File

@@ -6486,8 +6486,9 @@ syn_get_id(
int keep_state) // keep state of char at "col"
{
// When the position is not after the current position and in the same
// line of the same buffer, need to restart parsing.
if (wp->w_buffer != syn_buf
// line of the same window with the same buffer, need to restart parsing.
if (wp != syn_win
|| wp->w_buffer != syn_buf
|| lnum != current_lnum
|| col < current_col)
syntax_start(wp, lnum);