Mercurial > vim
comparison src/testdir/test_regexp_utf8.vim @ 17444:f4ce361bb1e5 v8.1.1720
patch 8.1.1720: crash with very long %[] pattern
commit https://github.com/vim/vim/commit/2a5b52758bb327b89d22660cc28c157ec29782e5
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 20 18:56:06 2019 +0200
patch 8.1.1720: crash with very long %[] pattern
Problem: Crash with very long %[] pattern. (Reza Mirzazade farkhani)
Solution: Check for reg_toolong. (closes https://github.com/vim/vim/issues/4703)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 20 Jul 2019 19:00:06 +0200 |
parents | 2e2f07561f4b |
children | bb87c5c1e29b |
comparison
equal
deleted
inserted
replaced
17443:613aced7fe57 | 17444:f4ce361bb1e5 |
---|---|
204 set re=2 | 204 set re=2 |
205 call assert_equal(0, 'abc def' =~# '[\u3000-\u4000]') | 205 call assert_equal(0, 'abc def' =~# '[\u3000-\u4000]') |
206 call assert_equal(1, "\u3042" =~# '[\u3000-\u4000]') | 206 call assert_equal(1, "\u3042" =~# '[\u3000-\u4000]') |
207 set re=0 | 207 set re=0 |
208 endfunc | 208 endfunc |
209 | |
210 func Test_optmatch_toolong() | |
211 set re=1 | |
212 " Can only handle about 8000 characters. | |
213 let pat = '\\%[' .. repeat('x', 9000) .. ']' | |
214 call assert_fails('call match("abc def", "' .. pat .. '")', 'E339:') | |
215 set re=0 | |
216 endfunc | |
217 |