File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1862,7 +1862,8 @@ luaV_setvar(lua_State *L)
18621862 return 0 ;
18631863 // Update the value
18641864 copy_tv (& tv , & di -> di_tv );
1865- dict_add (dict , di );
1865+ if (dict_add (dict , di ) == FAIL )
1866+ return luaL_error (L , "Couldn't add to dictionary" );
18661867 } else
18671868 {
18681869 // Clear the old value
Original file line number Diff line number Diff line change @@ -1009,6 +1009,10 @@ func Test_lua_global_var_table()
10091009 call assert_fails (' lua vim.g.Var2[3] = 21' , ' list is locked' )
10101010 unlockvar g: Var2
10111011
1012+ let g: TestFunc = function (' len' )
1013+ call assert_fails (' lua vim.g.func = vim.g.TestFunc' , [' E704:' , ' Couldn'' t add to dictionary' ])
1014+ unlet g: TestFunc
1015+
10121016 " Attempt to access a non-existing global variable
10131017 call assert_equal (v: null , luaeval (' vim.g.NonExistingVar' ))
10141018 lua vim .g .NonExisting = Nil
Original file line number Diff line number Diff line change @@ -755,6 +755,8 @@ static char *(features[]) =
755755
756756static int included_patches [] =
757757{ /* Add new patch number below this line */
758+ /**/
759+ 3291 ,
758760/**/
759761 3290 ,
760762/**/
You can’t perform that action at this time.
0 commit comments