summaryrefslogtreecommitdiff
path: root/src/ldblib.c
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2014-03-21 12:00:00 +0000
committerrepogen <>2014-03-21 12:00:00 +0000
commit05a6ab2dd30e7707c7d5424b905eb93a1dd5c5b2 (patch)
treef24db6e4692bebf7031418ff9c3b51b345016023 /src/ldblib.c
parent87cc247b6b22184fba47184c218a642ea7a49e96 (diff)
downloadlua-github-5.3.0-work2.tar.gz
Lua 5.3.0-work25.3.0-work2
Diffstat (limited to 'src/ldblib.c')
-rw-r--r--src/ldblib.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/ldblib.c b/src/ldblib.c
index 30499a62..8a724a1e 100644
--- a/src/ldblib.c
+++ b/src/ldblib.c
@@ -1,5 +1,5 @@
/*
-** $Id: ldblib.c,v 1.133 2013/06/25 19:37:00 roberto Exp $
+** $Id: ldblib.c,v 1.137 2014/03/12 20:57:40 roberto Exp $
** Interface from Lua to its debug API
** See Copyright Notice in lua.h
*/
@@ -69,11 +69,8 @@ static int db_getuservalue (lua_State *L) {
static int db_setuservalue (lua_State *L) {
- if (lua_type(L, 1) == LUA_TLIGHTUSERDATA)
- luaL_argerror(L, 1, "full userdata expected, got light userdata");
luaL_checktype(L, 1, LUA_TUSERDATA);
- if (!lua_isnoneornil(L, 2))
- luaL_checktype(L, 2, LUA_TTABLE);
+ luaL_checkany(L, 2);
lua_settop(L, 2);
lua_setuservalue(L, 1);
return 1;
@@ -273,8 +270,7 @@ static void hookf (lua_State *L, lua_Debug *ar) {
{"call", "return", "line", "count", "tail call"};
gethooktable(L);
lua_pushthread(L);
- lua_rawget(L, -2);
- if (lua_isfunction(L, -1)) {
+ if (lua_rawget(L, -2) == LUA_TFUNCTION) {
lua_pushstring(L, hooknames[(int)ar->event]);
if (ar->currentline >= 0)
lua_pushinteger(L, ar->currentline);