Patch 8.2.4440
Problem:    Crash with specific regexp pattern and string.
Solution:   Stop at the start of the string.
Files:      src/regexp_bt.c, src/testdir/test_regexp_utf8.vim


*** ../vim-8.2.4439/src/regexp_bt.c     2022-01-31 14:59:33.522943638 +0000
--- src/regexp_bt.c     2022-02-22 13:34:08.427901789 +0000
***************
*** 4615,4620 ****
--- 4615,4625 ----
                            if (rex.input == rex.line)
                            {
                                // backup to last char of previous line
+                               if (rex.lnum == 0)
+                               {
+                                   status = RA_NOMATCH;
+                                   break;
+                               }
                                --rex.lnum;
                                rex.line = reg_getline(rex.lnum);
                                // Just in case regrepeat() didn't count
*** ../vim-8.2.4439/src/testdir/test_regexp_utf8.vim    2022-01-31 
14:59:33.526943578 +0000
--- src/testdir/test_regexp_utf8.vim    2022-02-22 13:33:02.360143358 +0000
***************
*** 508,514 ****
  " Check that [[:upper:]] matches for automatic engine
  func Test_match_char_class_upper()
    new
-   let _engine=&regexpengine
  
    " Test 1: [[:upper:]]\{2,\}
    set regexpengine=0
--- 508,513 ----
***************
*** 549,555 ****
    call assert_equal(4, searchcount().total, 'TEST 3 lower')
  
    " clean up
!   let &regexpengine=_engine
    bwipe!
  endfunc
  
--- 548,554 ----
    call assert_equal(4, searchcount().total, 'TEST 3 lower')
  
    " clean up
!   set regexpengine=0
    bwipe!
  endfunc
  
***************
*** 561,564 ****
--- 560,572 ----
    call delete('Xinvalid')
  endfunc
  
+ func Test_match_too_complicated()
+   set regexpengine=1
+   exe "vsplit \xeb\xdb\x99"
+   silent! buf \&\zs*\zs*0
+   bwipe!
+   set regexpengine=0
+ endfunc
+ 
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.4439/src/version.c       2022-02-22 12:34:21.387356125 +0000
--- src/version.c       2022-02-22 13:35:03.939709698 +0000
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     4440,
  /**/

-- 
You can't have everything.  Where would you put it?
                -- Steven Wright

 /// 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/20220222133806.BD6321C14C0%40moolenaar.net.

Raspunde prin e-mail lui