0
0
mirror of https://github.com/vim/vim.git synced 2025-10-06 05:44:14 -04:00

patch 9.0.0804: crash when trying to divide a number by -1

Problem:    Crash when trying to divice the largest negative number by -1.
Solution:   Handle this case specifically.
This commit is contained in:
Bram Moolenaar
2022-10-20 14:17:18 +01:00
parent 43625762a9
commit cdef1cefa2
3 changed files with 15 additions and 1 deletions

View File

@@ -761,6 +761,12 @@ func Test_eval_after_if()
call assert_equal('b', s:val)
endfunc
func Test_divide_by_zero()
" only tests that this doesn't crash, the result is not important
echo 0 / 0
echo 0 / 0 / -1
endfunc
" Test for command-line completion of expressions
func Test_expr_completion()
CheckFeature cmdline_compl