diff --git a/bugs b/bugs index 3a9bf65a..4646057f 100644 --- a/bugs +++ b/bugs @@ -61,3 +61,9 @@ because "strtol" returns long, not unsigned long. ** lstrlib.c Mon Jan 4 10:41:40 EDT 1999 >> "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. + diff --git a/lapi.c b/lapi.c index f89bb153..6a553422 100644 --- a/lapi.c +++ b/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 ** 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 */ if (lua_tag(func) != LUA_T_PROTO) return LUA_NOOBJECT; @@ -510,7 +509,7 @@ lua_Object lua_getlocal (lua_Function func, int local_number, char **name) if (*name) { /* if "*name", there must be a LUA_T_LINE */ /* therefore, f+2 points to function base */ - return Ref((f+2)+(local_number-1)); + return put_luaObject((f+2)+(local_number-1)); } else return LUA_NOOBJECT;