To: vim_dev@googlegroups.com Subject: Patch 8.2.1234 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1234 Problem: Lua build problem with old compiler. Solution: Move declarations to start of the block. (Taro Muraoka, closes #6477) Files: src/if_lua.c *** ../vim-8.2.1233/src/if_lua.c 2020-07-14 21:54:24.755126054 +0200 --- src/if_lua.c 2020-07-18 12:50:01.237785877 +0200 *************** *** 626,633 **** case LUA_TFUNCTION: { char_u *name; lua_pushvalue(L, pos); ! luaV_CFuncState *state = ALLOC_CLEAR_ONE(luaV_CFuncState); state->lua_funcref = luaL_ref(L, LUA_REGISTRYINDEX); state->L = L; state->lua_tableref = LUA_NOREF; --- 626,635 ---- case LUA_TFUNCTION: { char_u *name; + luaV_CFuncState *state; + lua_pushvalue(L, pos); ! state = ALLOC_CLEAR_ONE(luaV_CFuncState); state->lua_funcref = luaL_ref(L, LUA_REGISTRYINDEX); state->L = L; state->lua_tableref = LUA_NOREF; *************** *** 639,652 **** } case LUA_TTABLE: { lua_pushvalue(L, pos); ! int lua_tableref = luaL_ref(L, LUA_REGISTRYINDEX); if (lua_getmetatable(L, pos)) { lua_getfield(L, -1, LUA___CALL); if (lua_isfunction(L, -1)) { char_u *name; int lua_funcref = luaL_ref(L, LUA_REGISTRYINDEX); luaV_CFuncState *state = ALLOC_CLEAR_ONE(luaV_CFuncState); state->lua_funcref = lua_funcref; state->L = L; state->lua_tableref = lua_tableref; --- 641,657 ---- } case LUA_TTABLE: { + int lua_tableref; + lua_pushvalue(L, pos); ! lua_tableref = luaL_ref(L, LUA_REGISTRYINDEX); if (lua_getmetatable(L, pos)) { lua_getfield(L, -1, LUA___CALL); if (lua_isfunction(L, -1)) { char_u *name; int lua_funcref = luaL_ref(L, LUA_REGISTRYINDEX); luaV_CFuncState *state = ALLOC_CLEAR_ONE(luaV_CFuncState); + state->lua_funcref = lua_funcref; state->L = L; state->lua_tableref = lua_tableref; *************** *** 703,708 **** --- 708,714 ---- if (lua_rawequal(L, -1, -5)) { luaV_Funcref *f = (luaV_Funcref *) p; + func_ref(f->name); tv->v_type = VAR_FUNC; tv->vval.v_string = vim_strsave(f->name); *** ../vim-8.2.1233/src/version.c 2020-07-17 23:03:14.327640784 +0200 --- src/version.c 2020-07-18 12:48:27.734082002 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1234, /**/ -- hundred-and-one symptoms of being an internet addict: 35. Your husband tells you he's had that beard for 2 months. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///