From aadc35449ec2752c298a7a8fa6359a3a12c538ee Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 24 Oct 2000 17:19:15 -0200 Subject: [PATCH] lua_settag does not pop its argument --- lapi.c | 3 +-- lbaselib.c | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lapi.c b/lapi.c index c2a22774..f0c64191 100644 --- a/lapi.c +++ b/lapi.c @@ -1,5 +1,5 @@ /* -** $Id: lapi.c,v 1.106 2000/10/06 19:29:26 roberto Exp roberto $ +** $Id: lapi.c,v 1.107 2000/10/20 16:39:03 roberto Exp roberto $ ** Lua API ** See Copyright Notice in lua.h */ @@ -433,7 +433,6 @@ LUA_API void lua_settag (lua_State *L, int tag) { luaO_verror(L, "cannot change the tag of a %.20s", luaO_typename(L->top-1)); } - L->top--; } diff --git a/lbaselib.c b/lbaselib.c index c27c7c01..bb5a0d7f 100644 --- a/lbaselib.c +++ b/lbaselib.c @@ -1,5 +1,5 @@ /* -** $Id: lbaselib.c,v 1.12 2000/10/20 16:39:03 roberto Exp roberto $ +** $Id: lbaselib.c,v 1.13 2000/10/20 16:57:42 roberto Exp roberto $ ** Basic library ** See Copyright Notice in lua.h */ @@ -138,8 +138,7 @@ static int luaB_settag (lua_State *L) { luaL_checktype(L, 1, LUA_TTABLE); lua_pushvalue(L, 1); /* push table */ lua_settag(L, luaL_check_int(L, 2)); - lua_pop(L, 1); /* remove second argument */ - return 1; /* return first argument */ + return 1; /* return table */ } static int luaB_newtag (lua_State *L) {