mirror of
https://github.com/lua/lua.git
synced 2024-11-28 04:33:53 +08:00
'debug.[gs]etupvalue' should be able to access C upvalues too
This commit is contained in:
parent
4b44793dc5
commit
a68494fb32
3
ldblib.c
3
ldblib.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: ldblib.c,v 1.110 2009/02/17 13:21:28 roberto Exp roberto $
|
||||
** $Id: ldblib.c,v 1.111 2009/08/04 18:27:57 roberto Exp roberto $
|
||||
** Interface from Lua to its debug API
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -180,7 +180,6 @@ static int auxupvalue (lua_State *L, int get) {
|
||||
const char *name;
|
||||
int n = luaL_checkint(L, 2);
|
||||
luaL_checktype(L, 1, LUA_TFUNCTION);
|
||||
if (lua_iscfunction(L, 1)) return 0; /* cannot touch C upvalues from Lua */
|
||||
name = get ? lua_getupvalue(L, 1, n) : lua_setupvalue(L, 1, n);
|
||||
if (name == NULL) return 0;
|
||||
lua_pushstring(L, name);
|
||||
|
Loading…
Reference in New Issue
Block a user