0
0
mirror of https://github.com/vim/vim.git synced 2025-10-15 07:14:09 -04:00

patch 8.2.3291: Coverity warns for not checking return value

Problem:    Coverity warns for not checking return value.
Solution:   If dict_add() fails give an error message.
This commit is contained in:
Bram Moolenaar
2021-08-05 15:11:08 +02:00
parent 9fe17d473a
commit 4a01159da2
3 changed files with 8 additions and 1 deletions

View File

@@ -1009,6 +1009,10 @@ func Test_lua_global_var_table()
call assert_fails('lua vim.g.Var2[3] = 21', 'list is locked')
unlockvar g:Var2
let g:TestFunc = function('len')
call assert_fails('lua vim.g.func = vim.g.TestFunc', ['E704:', 'Couldn''t add to dictionary'])
unlet g:TestFunc
" Attempt to access a non-existing global variable
call assert_equal(v:null, luaeval('vim.g.NonExistingVar'))
lua vim.g.NonExisting = Nil