To: vim_dev@googlegroups.com Subject: Patch 8.0.1078 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1078 Problem: Using freed memory with ":hi Normal". Solution: Get "item" again after updating the table. Files: src/syntax.c *** ../vim-8.0.1077/src/syntax.c 2017-09-08 12:37:43.381853448 +0200 --- src/syntax.c 2017-09-09 15:26:58.911020802 +0200 *************** *** 7381,7386 **** --- 7381,7389 ---- # define is_menu_group 0 # define is_tooltip_group 0 #endif + #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) + int did_highlight_changed = FALSE; + #endif /* * If no argument, list current highlighting. *************** *** 7568,7575 **** #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) if (USE_24BIT) highlight_gui_started(); #endif ! highlight_changed(); redraw_later_clear(); return; } --- 7571,7579 ---- #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) if (USE_24BIT) highlight_gui_started(); + else #endif ! highlight_changed(); redraw_later_clear(); return; } *************** *** 8174,8180 **** --- 8178,8189 ---- #endif #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) if (USE_24BIT) + { highlight_gui_started(); + item = &HL_TABLE()[idx]; /* table may have changed */ + did_highlight_changed = TRUE; + redraw_all_later(NOT_VALID); + } #endif } #ifdef FEAT_GUI_X11 *************** *** 8210,8216 **** /* Only call highlight_changed() once, after a sequence of highlight * commands, and only if an attribute actually changed. */ ! if (memcmp(item, &item_before, sizeof(item_before)) != 0) { redraw_all_later(NOT_VALID); need_highlight_changed = TRUE; --- 8219,8229 ---- /* Only call highlight_changed() once, after a sequence of highlight * commands, and only if an attribute actually changed. */ ! if (memcmp(item, &item_before, sizeof(item_before)) != 0 ! #if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS) ! && !did_highlight_changed ! #endif ! ) { redraw_all_later(NOT_VALID); need_highlight_changed = TRUE; *** ../vim-8.0.1077/src/version.c 2017-09-08 20:49:47.620907422 +0200 --- src/version.c 2017-09-09 15:27:53.342623343 +0200 *************** *** 771,772 **** --- 771,774 ---- { /* Add new patch number below this line */ + /**/ + 1078, /**/ -- From "know your smileys": @:-() Elvis Presley /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///