1
0
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:
Bram Moolenaar
2021-11-24 12:17:53 +00:00
parent 48608b4a4b
commit 03725c5795
6 changed files with 65 additions and 7 deletions

View File

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