To: vim_dev@googlegroups.com Subject: Patch 9.0.0750 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0750 Problem: Crash when popup closed in callback. (Maxim Kim) Solution: In syntax_end_parsing() check that syn_block is valid. Files: src/syntax.c, src/proto/syntax.pro, src/drawscreen.c *** ../vim-9.0.0749/src/syntax.c 2022-09-17 21:07:52.099993159 +0100 --- src/syntax.c 2022-10-14 17:00:06.542509438 +0100 *************** *** 1542,1551 **** * lnum -> line below window */ void ! syntax_end_parsing(linenr_T lnum) { synstate_T *sp; sp = syn_stack_find_entry(lnum); if (sp != NULL && sp->sst_lnum < lnum) sp = sp->sst_next; --- 1542,1553 ---- * lnum -> line below window */ void ! 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; *** ../vim-9.0.0749/src/proto/syntax.pro 2022-06-27 23:15:24.000000000 +0100 --- src/proto/syntax.pro 2022-10-14 17:02:42.931326388 +0100 *************** *** 2,8 **** 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); 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); --- 2,8 ---- 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(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); *** ../vim-9.0.0749/src/drawscreen.c 2022-10-13 22:12:07.164673822 +0100 --- src/drawscreen.c 2022-10-14 17:02:50.471360276 +0100 *************** *** 2486,2492 **** // 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); #endif // Display one line. --- 2486,2492 ---- // 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(wp, syntax_last_parsed + 1); #endif // Display one line. *************** *** 2601,2607 **** #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); #endif // If we didn't hit the end of the file, and we didn't finish the last --- 2601,2607 ---- #ifdef FEAT_SYN_HL // Let the syntax stuff know we stop parsing here. if (syntax_last_parsed != 0 && syntax_present(wp)) ! 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 *** ../vim-9.0.0749/src/version.c 2022-10-14 13:11:10.128828896 +0100 --- src/version.c 2022-10-14 17:01:11.350876166 +0100 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 750, /**/ -- In Africa some of the native tribes have a custom of beating the ground with clubs and uttering spine chilling cries. Anthropologists call this a form of primitive self-expression. In America we call it golf. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///