To: vim_dev@googlegroups.com Subject: Patch 8.1.1665 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.1665 Problem: Crash when popup window with mask is below the screen. Solution: Correct boundary check. Files: src/popupwin.c, src/testdir/test_popupwin.vim, src/testdir/dumps/Test_popupwin_mask_5.dump *** ../vim-8.1.1664/src/popupwin.c 2019-07-12 13:59:16.771261635 +0200 --- src/popupwin.c 2019-07-12 16:01:54.503541838 +0200 *************** *** 2323,2330 **** --lines; if (lines < 0) lines = 0; ! for (line = lines; line < linee && line < screen_Rows; ++line) ! for (col = cols; col < cole && col < screen_Columns; ++col) popup_transparent[(line + wp->w_winrow) * screen_Columns + col + wp->w_wincol] = val; } --- 2323,2332 ---- --lines; if (lines < 0) lines = 0; ! for (line = lines; line < linee ! && line + wp->w_winrow < screen_Rows; ++line) ! for (col = cols; col < cole ! && col + wp->w_wincol < screen_Columns; ++col) popup_transparent[(line + wp->w_winrow) * screen_Columns + col + wp->w_wincol] = val; } *** ../vim-8.1.1664/src/testdir/test_popupwin.vim 2019-07-09 20:25:19.911815741 +0200 --- src/testdir/test_popupwin.vim 2019-07-12 15:55:37.453321665 +0200 *************** *** 486,491 **** --- 486,495 ---- call term_sendkeys(buf, ":call popup_move(winidb, {'pos': 'topright', 'col': 12})\") call VerifyScreenDump(buf, 'Test_popupwin_mask_4', {}) + call term_sendkeys(buf, ":call popup_move(winid, {'pos': 'topright', 'col': 12, 'line': 11})\") + call term_sendkeys(buf, ":call popup_move(winidb, {'pos': 'topleft', 'col': 42, 'line': 11})\") + call VerifyScreenDump(buf, 'Test_popupwin_mask_5', {}) + " clean up call StopVimInTerminal(buf) call delete('XtestPopupMask') *** ../vim-8.1.1664/src/testdir/dumps/Test_popupwin_mask_5.dump 2019-07-12 16:05:11.266641091 +0200 --- src/testdir/dumps/Test_popupwin_mask_5.dump 2019-07-12 15:55:47.561272630 +0200 *************** *** 0 ****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|i|n|e| |║|,+0#0000000#ffffff0|1| @10|T|o|p| *** ../vim-8.1.1664/src/version.c 2019-07-12 15:37:09.250799642 +0200 --- src/version.c 2019-07-12 16:04:10.994915602 +0200 *************** *** 779,780 **** --- 779,782 ---- { /* Add new patch number below this line */ + /**/ + 1665, /**/ -- If your life is a hard drive, Christ can be your backup. /// 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 ///