lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 80001ab0eb3ad95f370796b26dacfdd7e9874877
parent ae29ab9858514eb264be590163c698d5172bbaa4
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Wed,  3 Feb 1999 14:42:20 -0200

getlocal cannot return the local itself, since lua_isstring and
lua_isnumber can modify it.

Diffstat:
Mbugs | 6++++++
Mlapi.c | 7+++----
2 files changed, 9 insertions(+), 4 deletions(-)

diff --git 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 @@ -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;