Patch 8.2.2510
Problem: Internal error when popup with mask is zero height or width.
Solution: Bail out if width or height is zero. (closes #7831)
Files: src/popupwin.c, src/testdir/test_popupwin.vim
*** ../vim-8.2.2509/src/popupwin.c 2021-02-10 14:55:46.261748696 +0100
--- src/popupwin.c 2021-02-13 21:29:42.256660838 +0100
***************
*** 3331,3338 ****
char_u *cells;
int row, col;
! if (wp->w_popup_mask == NULL)
return;
if (wp->w_popup_mask_cells != NULL
&& wp->w_popup_mask_height == height
&& wp->w_popup_mask_width == width)
--- 3331,3342 ----
char_u *cells;
int row, col;
! if (wp->w_popup_mask == NULL || width == 0 || height == 0)
! {
! vim_free(wp->w_popup_mask_cells);
! wp->w_popup_mask_cells = NULL;
return;
+ }
if (wp->w_popup_mask_cells != NULL
&& wp->w_popup_mask_height == height
&& wp->w_popup_mask_width == width)
*** ../vim-8.2.2509/src/testdir/test_popupwin.vim 2021-02-10 14:55:46.261748696 +0100
--- src/testdir/test_popupwin.vim 2021-02-13 21:29:08.888699727 +0100
***************
*** 825,830 ****
--- 825,849 ----
" this was causing a crash
call popup_create('test', #{mask: [[0, 0, 0, 0]]})
call popup_clear()
+
+ " this was causing an internal error
+ enew
+ set nowrap
+ call repeat('x', &columns)->setline(1)
+ call prop_type_add('textprop', {})
+ call prop_add(1, 1, #{length: &columns, type: 'textprop'})
+ vsplit
+ let opts = popup_create('', #{textprop: 'textprop'})
+ \ ->popup_getoptions()
+ \ ->extend(#{mask: [[1, 1, 1, 1]]})
+ call popup_create('', opts)
+ redraw
+
+ close!
+ bwipe!
+ call prop_type_delete('textprop')
+ call popup_clear()
+ set wrap&
endfunc
func Test_popup_select()
*** ../vim-8.2.2509/src/version.c 2021-02-13 18:32:59.264950079 +0100
--- src/version.c 2021-02-13 21:21:02.181543942 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2510,
/**/
--
With sufficient thrust, pigs fly just fine.
-- RFC 1925
/// Bram Moolenaar -- Br...@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 ///