summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0935
blob: c9e006aeb0c32606a3c7a60bd21b404718898400 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0935
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0935
Problem:    Old regexp engine may use invalid buffer for 'iskeyword' or
            uninitialized buffer pointer. (Kuang-che Wu)
Solution:   Set rex.reg_buf when compiling the pattern. (closes #3972)
Files:	    src/regexp.c, src/testdir/test_regexp_latin.vim


*** ../vim-8.1.0934/src/regexp.c	2019-02-16 17:07:44.484675212 +0100
--- src/regexp.c	2019-02-16 17:45:39.915606324 +0100
***************
*** 7998,8003 ****
--- 7998,8005 ----
      bt_regengine.expr = expr;
      nfa_regengine.expr = expr;
  #endif
+     // reg_iswordc() uses rex.reg_buf
+     rex.reg_buf = curbuf;
  
      /*
       * First try the NFA engine, unless backtracking was requested.
*** ../vim-8.1.0934/src/testdir/test_regexp_latin.vim	2019-02-16 17:07:44.484675212 +0100
--- src/testdir/test_regexp_latin.vim	2019-02-16 17:42:03.660852804 +0100
***************
*** 104,106 ****
--- 104,122 ----
    s/^/[[=
    call assert_equal(1, search(getline(1)))
  endfunc
+ 
+ func Test_rex_init()
+   set noincsearch
+   set re=1
+   new
+   setlocal iskeyword=a-z
+   call setline(1, ['abc', 'ABC'])
+   call assert_equal(1, search('[[:keyword:]]'))
+   new
+   setlocal iskeyword=A-Z
+   call setline(1, ['abc', 'ABC'])
+   call assert_equal(2, search('[[:keyword:]]'))
+   bwipe!
+   bwipe!
+   set re=0
+ endfunc
*** ../vim-8.1.0934/src/version.c	2019-02-16 17:07:44.484675212 +0100
--- src/version.c	2019-02-16 17:47:02.471130460 +0100
***************
*** 781,782 ****
--- 781,784 ----
  {   /* Add new patch number below this line */
+ /**/
+     935,
  /**/

-- 
This computer is so slow, it takes forever to execute and endless loop!

 /// 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    ///