summaryrefslogtreecommitdiff
path: root/src/ldblib.c
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2008-01-21 12:00:00 +0000
committerrepogen <>2008-01-21 12:00:00 +0000
commit52441b3df3a2448a8a30548a19601c6fc5689934 (patch)
tree9c3e94e8324f34bfa3bc5c06fbe2a7f87e2e96d3 /src/ldblib.c
parent9ea694597c18612146b3423c9b343d15a4e57682 (diff)
downloadlua-github-5.1.3-rc5.tar.gz
Diffstat (limited to 'src/ldblib.c')
-rw-r--r--src/ldblib.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/ldblib.c b/src/ldblib.c
index 8d631e37..67de1222 100644
--- a/src/ldblib.c
+++ b/src/ldblib.c
@@ -1,5 +1,5 @@
/*
-** $Id: ldblib.c,v 1.104.1.2 2008/01/18 16:39:45 roberto Exp $
+** $Id: ldblib.c,v 1.104.1.3 2008/01/21 13:11:21 roberto Exp $
** Interface from Lua to its debug API
** See Copyright Notice in lua.h
*/
@@ -268,12 +268,11 @@ static int db_sethook (lua_State *L) {
count = luaL_optint(L, arg+3, 0);
func = hookf; mask = makemask(smask, count);
}
- gethooktable(L1);
- lua_pushlightuserdata(L1, L1);
+ gethooktable(L);
+ lua_pushlightuserdata(L, L1);
lua_pushvalue(L, arg+1);
- lua_xmove(L, L1, 1);
- lua_rawset(L1, -3); /* set new hook */
- lua_pop(L1, 1); /* remove hook table */
+ lua_rawset(L, -3); /* set new hook */
+ lua_pop(L, 1); /* remove hook table */
lua_sethook(L1, func, mask, count); /* set hooks */
return 0;
}
@@ -288,11 +287,10 @@ static int db_gethook (lua_State *L) {
if (hook != NULL && hook != hookf) /* external hook? */
lua_pushliteral(L, "external hook");
else {
- gethooktable(L1);
- lua_pushlightuserdata(L1, L1);
- lua_rawget(L1, -2); /* get hook */
- lua_remove(L1, -2); /* remove hook table */
- lua_xmove(L1, L, 1);
+ gethooktable(L);
+ lua_pushlightuserdata(L, L1);
+ lua_rawget(L, -2); /* get hook */
+ lua_remove(L, -2); /* remove hook table */
}
lua_pushstring(L, unmakemask(mask, buff));
lua_pushinteger(L, lua_gethookcount(L1));