To: vim_dev@googlegroups.com Subject: Patch 8.1.0935 Fcc: outbox From: Bram Moolenaar 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 ///