mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.1234: Lua build problem with old compiler
Problem: Lua build problem with old compiler. Solution: Move declarations to start of the block. (Taro Muraoka, closes #6477)
This commit is contained in:
10
src/if_lua.c
10
src/if_lua.c
@@ -626,8 +626,10 @@ luaV_totypval(lua_State *L, int pos, typval_T *tv)
|
|||||||
case LUA_TFUNCTION:
|
case LUA_TFUNCTION:
|
||||||
{
|
{
|
||||||
char_u *name;
|
char_u *name;
|
||||||
|
luaV_CFuncState *state;
|
||||||
|
|
||||||
lua_pushvalue(L, pos);
|
lua_pushvalue(L, pos);
|
||||||
luaV_CFuncState *state = ALLOC_CLEAR_ONE(luaV_CFuncState);
|
state = ALLOC_CLEAR_ONE(luaV_CFuncState);
|
||||||
state->lua_funcref = luaL_ref(L, LUA_REGISTRYINDEX);
|
state->lua_funcref = luaL_ref(L, LUA_REGISTRYINDEX);
|
||||||
state->L = L;
|
state->L = L;
|
||||||
state->lua_tableref = LUA_NOREF;
|
state->lua_tableref = LUA_NOREF;
|
||||||
@@ -639,14 +641,17 @@ luaV_totypval(lua_State *L, int pos, typval_T *tv)
|
|||||||
}
|
}
|
||||||
case LUA_TTABLE:
|
case LUA_TTABLE:
|
||||||
{
|
{
|
||||||
|
int lua_tableref;
|
||||||
|
|
||||||
lua_pushvalue(L, pos);
|
lua_pushvalue(L, pos);
|
||||||
int lua_tableref = luaL_ref(L, LUA_REGISTRYINDEX);
|
lua_tableref = luaL_ref(L, LUA_REGISTRYINDEX);
|
||||||
if (lua_getmetatable(L, pos)) {
|
if (lua_getmetatable(L, pos)) {
|
||||||
lua_getfield(L, -1, LUA___CALL);
|
lua_getfield(L, -1, LUA___CALL);
|
||||||
if (lua_isfunction(L, -1)) {
|
if (lua_isfunction(L, -1)) {
|
||||||
char_u *name;
|
char_u *name;
|
||||||
int lua_funcref = luaL_ref(L, LUA_REGISTRYINDEX);
|
int lua_funcref = luaL_ref(L, LUA_REGISTRYINDEX);
|
||||||
luaV_CFuncState *state = ALLOC_CLEAR_ONE(luaV_CFuncState);
|
luaV_CFuncState *state = ALLOC_CLEAR_ONE(luaV_CFuncState);
|
||||||
|
|
||||||
state->lua_funcref = lua_funcref;
|
state->lua_funcref = lua_funcref;
|
||||||
state->L = L;
|
state->L = L;
|
||||||
state->lua_tableref = lua_tableref;
|
state->lua_tableref = lua_tableref;
|
||||||
@@ -703,6 +708,7 @@ luaV_totypval(lua_State *L, int pos, typval_T *tv)
|
|||||||
if (lua_rawequal(L, -1, -5))
|
if (lua_rawequal(L, -1, -5))
|
||||||
{
|
{
|
||||||
luaV_Funcref *f = (luaV_Funcref *) p;
|
luaV_Funcref *f = (luaV_Funcref *) p;
|
||||||
|
|
||||||
func_ref(f->name);
|
func_ref(f->name);
|
||||||
tv->v_type = VAR_FUNC;
|
tv->v_type = VAR_FUNC;
|
||||||
tv->vval.v_string = vim_strsave(f->name);
|
tv->vval.v_string = vim_strsave(f->name);
|
||||||
|
@@ -754,6 +754,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1234,
|
||||||
/**/
|
/**/
|
||||||
1233,
|
1233,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user