summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-10-14 17:04:09 +0100
committerBram Moolenaar <Bram@vim.org>2022-10-14 17:04:09 +0100
commit0abd6cf62d65180dc2c40d67cd95f13b0691f7ea (patch)
tree8abf50c2a29bdbbf715be0960ff80b8592644cf3 /src
parent975a665d4811649a51e2c6a97a6ce096290d87ae (diff)
downloadvim-git-0abd6cf62d65180dc2c40d67cd95f13b0691f7ea.tar.gz
patch 9.0.0750: crash when popup closed in callbackv9.0.0750
Problem: Crash when popup closed in callback. (Maxim Kim) Solution: In syntax_end_parsing() check that syn_block is valid.
Diffstat (limited to 'src')
-rw-r--r--src/drawscreen.c4
-rw-r--r--src/proto/syntax.pro2
-rw-r--r--src/syntax.c4
-rw-r--r--src/version.c2
4 files changed, 8 insertions, 4 deletions
diff --git a/src/drawscreen.c b/src/drawscreen.c
index d55c2eaec..5a23d54fd 100644
--- a/src/drawscreen.c
+++ b/src/drawscreen.c
@@ -2486,7 +2486,7 @@ win_update(win_T *wp)
// Let the syntax stuff know we skipped a few lines.
if (syntax_last_parsed != 0 && syntax_last_parsed + 1 < lnum
&& syntax_present(wp))
- syntax_end_parsing(syntax_last_parsed + 1);
+ syntax_end_parsing(wp, syntax_last_parsed + 1);
#endif
// Display one line.
@@ -2601,7 +2601,7 @@ win_update(win_T *wp)
#ifdef FEAT_SYN_HL
// Let the syntax stuff know we stop parsing here.
if (syntax_last_parsed != 0 && syntax_present(wp))
- syntax_end_parsing(syntax_last_parsed + 1);
+ syntax_end_parsing(wp, syntax_last_parsed + 1);
#endif
// If we didn't hit the end of the file, and we didn't finish the last
diff --git a/src/proto/syntax.pro b/src/proto/syntax.pro
index c06498c87..c51da7ab8 100644
--- a/src/proto/syntax.pro
+++ b/src/proto/syntax.pro
@@ -2,7 +2,7 @@
void syntax_start(win_T *wp, linenr_T lnum);
void syn_stack_free_all(synblock_T *block);
void syn_stack_apply_changes(buf_T *buf);
-void syntax_end_parsing(linenr_T lnum);
+void syntax_end_parsing(win_T *wp, linenr_T lnum);
int syntax_check_changed(linenr_T lnum);
int get_syntax_attr(colnr_T col, int *can_spell, int keep_state);
void syntax_clear(synblock_T *block);
diff --git a/src/syntax.c b/src/syntax.c
index ea8d541de..468dee09a 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1542,10 +1542,12 @@ syn_stack_equal(synstate_T *sp)
* lnum -> line below window
*/
void
-syntax_end_parsing(linenr_T lnum)
+syntax_end_parsing(win_T *wp, linenr_T lnum)
{
synstate_T *sp;
+ if (syn_block != wp->w_s)
+ return; // not the right window
sp = syn_stack_find_entry(lnum);
if (sp != NULL && sp->sst_lnum < lnum)
sp = sp->sst_next;
diff --git a/src/version.c b/src/version.c
index 708e762f7..bd9915a80 100644
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 750,
+/**/
749,
/**/
748,