Problem: Coverity warns for not checking return value.
Solution: If dict_add() fails give an error message.
return 0;
// Update the value
copy_tv(&tv, &di->di_tv);
- dict_add(dict, di);
+ if (dict_add(dict, di) == FAIL)
+ return luaL_error(L, "Couldn't add to dictionary");
} else
{
// Clear the old value
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
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 3291,
/**/
3290,
/**/