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

@@ -655,4 +655,16 @@ func Test_not_break_expression_register()
call assert_equal('1+1', getreg('=', 1))
endfunc
func Test_address_line_overflow()
if v:sizeoflong < 8
throw 'Skipped: only works with 64 bit long ints'
endif
new
call setline(1, 'text')
call assert_fails('|.44444444444444444444444', 'E1247:')
call assert_fails('|.9223372036854775806', 'E1247:')
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab