comparison src/testdir/test_search.vim @ 15959:4feaa025491b v8.1.0985

patch 8.1.0985: crash with large number in regexp commit https://github.com/vim/vim/commit/ab350f89f9646e07aefe16a32ba3ddb847496b4a Author: Bram Moolenaar <Bram@vim.org> Date: Thu Feb 28 06:25:00 2019 +0100 patch 8.1.0985: crash with large number in regexp Problem: Crash with large number in regexp. (Kuang-che Wu) Solution: Check for long becoming negative int. (closes #)
author Bram Moolenaar <Bram@vim.org>
date Thu, 28 Feb 2019 06:30:11 +0100
parents ff00d207cc5e
children a6cffc232b9d
comparison
equal deleted inserted replaced
15958:5b3c0bb37ebc 15959:4feaa025491b
1210 call assert_equal(5, line('.')) 1210 call assert_equal(5, line('.'))
1211 call assert_equal(bufcontent[1], @/) 1211 call assert_equal(bufcontent[1], @/)
1212 call Incsearch_cleanup() 1212 call Incsearch_cleanup()
1213 endfunc 1213 endfunc
1214 1214
1215 func Test_large_hex_chars() 1215 func Test_large_hex_chars1()
1216 " This used to cause a crash, the character becomes an NFA state. 1216 " This used to cause a crash, the character becomes an NFA state.
1217 try 1217 try
1218 /\%Ufffffc23 1218 /\%Ufffffc23
1219 catch 1219 catch
1220 call assert_match('E678:', v:exception) 1220 call assert_match('E678:', v:exception)
1221 endtry 1221 endtry
1222 try
1223 set re=1
1224 /\%Ufffffc23
1225 catch
1226 call assert_match('E678:', v:exception)
1227 endtry
1228 set re&
1229 endfunc
1230
1231 func Test_large_hex_chars2()
1232 " This used to cause a crash, the character becomes an NFA state.
1233 try
1234 /[\Ufffffc1f]
1235 catch
1236 call assert_match('E486:', v:exception)
1237 endtry
1238 try
1239 set re=1
1240 /[\Ufffffc1f]
1241 catch
1242 call assert_match('E486:', v:exception)
1243 endtry
1244 set re&
1222 endfunc 1245 endfunc
1223 1246
1224 func Test_one_error_msg() 1247 func Test_one_error_msg()
1225 " This was also giving an internal error 1248 " This was also giving an internal error
1226 call assert_fails('call search(" \\((\\v[[=P=]]){185}+ ")', 'E871:') 1249 call assert_fails('call search(" \\((\\v[[=P=]]){185}+ ")', 'E871:')