mirror of
https://github.com/neovim/neovim.git
synced 2025-12-09 16:12:48 +00:00
vim-patch:8.2.1945: crash when passing NULL function to reduce()
Problem: Crash when passing NULL function to reduce().
Solution: Check for NULL pointer and give an error. (Dominique Pellé,
closes vim/vim#7243)
0d90e728fe
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -747,6 +747,10 @@ func Test_reduce()
|
||||
|
||||
call assert_equal(42, reduce(v:_null_list, function('add'), 42))
|
||||
call assert_equal(42, reduce(v:_null_blob, function('add'), 42))
|
||||
|
||||
" should not crash
|
||||
" Nvim doesn't have null functions
|
||||
" call assert_fails('echo reduce([1], test_null_function())', 'E1132:')
|
||||
endfunc
|
||||
|
||||
" splitting a string to a List using split()
|
||||
|
||||
Reference in New Issue
Block a user