Patch 8.2.4261
Problem:    Accessing invalid memory when a regular expression checks the
            Visual area while matching in a string.
Solution:   Do not try matching the Visual area in a string.
Files:      src/regexp.c, src/testdir/test_help.vim


*** ../vim-8.2.4260/src/regexp.c        2022-01-05 20:24:34.276005641 +0000
--- src/regexp.c        2022-01-30 16:41:32.350739976 +0000
***************
*** 1267,1274 ****
      colnr_T   cols;
      colnr_T   curswant;
  
!     // Check if the buffer is the current buffer.
!     if (rex.reg_buf != curbuf || VIsual.lnum == 0)
        return FALSE;
  
      if (VIsual_active)
--- 1267,1274 ----
      colnr_T   cols;
      colnr_T   curswant;
  
!     // Check if the buffer is the current buffer and not using a string.
!     if (rex.reg_buf != curbuf || VIsual.lnum == 0 || rex.reg_maxline == 0)
        return FALSE;
  
      if (VIsual_active)
*** ../vim-8.2.4260/src/testdir/test_help.vim   2022-01-03 12:53:20.662699885 
+0000
--- src/testdir/test_help.vim   2022-01-30 16:40:38.583614348 +0000
***************
*** 1,6 ****
--- 1,7 ----
  " Tests for :help
  
  source check.vim
+ import './vim9.vim' as v9
  
  func Test_help_restore_snapshot()
    help
***************
*** 168,172 ****
--- 169,183 ----
    endtry
  endfunc
  
+ func Test_help_using_visual_match()
+   let lines =<< trim END
+       call setline(1, ' ')
+       /^
+       exe "normal \<C-V>\<C-V>"
+       h5\%V€]
+   END
+   call v9.CheckScriptFailure(lines, 'E149:')
+ endfunc
+ 
  
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.4260/src/version.c       2022-01-30 15:28:26.646294975 +0000
--- src/version.c       2022-01-30 16:11:17.545709897 +0000
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     4261,
  /**/

-- 
DENNIS: Oh, very nice. King, eh!  I expect you've got a palace and fine
        clothes and courtiers and plenty of food.  And how d'you get that?  By
        exploiting the workers! By hanging on to outdated imperialist dogma
        which perpetuates the social and economic differences in our society!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220130164349.F0D281C1918%40moolenaar.net.

Raspunde prin e-mail lui