forked from aniani/vim
patch 8.2.3659: integer overflow with large line number
Problem: Integer overflow with large line number. Solution: Check for overflow. (closes #9202)
This commit is contained in:
@@ -3519,4 +3519,25 @@ func Test_normal_gj_on_extra_wide_char()
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
func Test_normal_count_out_of_range()
|
||||
new
|
||||
call setline(1, 'text')
|
||||
normal 44444444444|
|
||||
call assert_equal(999999999, v:count)
|
||||
normal 444444444444|
|
||||
call assert_equal(999999999, v:count)
|
||||
normal 4444444444444|
|
||||
call assert_equal(999999999, v:count)
|
||||
normal 4444444444444444444|
|
||||
call assert_equal(999999999, v:count)
|
||||
|
||||
normal 9y99999999|
|
||||
call assert_equal(899999991, v:count)
|
||||
normal 10y99999999|
|
||||
call assert_equal(999999999, v:count)
|
||||
normal 44444444444y44444444444|
|
||||
call assert_equal(999999999, v:count)
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
Reference in New Issue
Block a user