mirror of https://github.com/rusefi/lua.git
getlocal cannot return the local itself, since lua_isstring and
lua_isnumber can modify it.
This commit is contained in:
parent
ae29ab9858
commit
80001ab0eb
6
bugs
6
bugs
|
@ -61,3 +61,9 @@ because "strtol" returns long, not unsigned long.
|
||||||
** lstrlib.c
|
** lstrlib.c
|
||||||
Mon Jan 4 10:41:40 EDT 1999
|
Mon Jan 4 10:41:40 EDT 1999
|
||||||
>> "format" does not check size of format item (such as "%00000...00000d").
|
>> "format" does not check size of format item (such as "%00000...00000d").
|
||||||
|
|
||||||
|
** lapi.c
|
||||||
|
Wed Feb 3 14:40:21 EDT 1999
|
||||||
|
>> getlocal cannot return the local itself, since lua_isstring and
|
||||||
|
lua_isnumber can modify it.
|
||||||
|
|
||||||
|
|
7
lapi.c
7
lapi.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lapi.c,v 1.31 1999/01/15 13:11:22 roberto Exp roberto $
|
** $Id: lapi.c,v 1.32 1999/01/26 15:31:17 roberto Exp roberto $
|
||||||
** Lua API
|
** Lua API
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -498,8 +498,7 @@ int lua_currentline (lua_Function func)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
lua_Object lua_getlocal (lua_Function func, int local_number, char **name)
|
lua_Object lua_getlocal (lua_Function func, int local_number, char **name) {
|
||||||
{
|
|
||||||
/* check whether func is a Lua function */
|
/* check whether func is a Lua function */
|
||||||
if (lua_tag(func) != LUA_T_PROTO)
|
if (lua_tag(func) != LUA_T_PROTO)
|
||||||
return LUA_NOOBJECT;
|
return LUA_NOOBJECT;
|
||||||
|
@ -510,7 +509,7 @@ lua_Object lua_getlocal (lua_Function func, int local_number, char **name)
|
||||||
if (*name) {
|
if (*name) {
|
||||||
/* if "*name", there must be a LUA_T_LINE */
|
/* if "*name", there must be a LUA_T_LINE */
|
||||||
/* therefore, f+2 points to function base */
|
/* therefore, f+2 points to function base */
|
||||||
return Ref((f+2)+(local_number-1));
|
return put_luaObject((f+2)+(local_number-1));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return LUA_NOOBJECT;
|
return LUA_NOOBJECT;
|
||||||
|
|
Loading…
Reference in New Issue