From a3addae03634794b841b6c8c4dd8ff83542d8896 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 12 Mar 2014 17:57:40 -0300 Subject: lua_gettable and similars return type of gotten value --- ldblib.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ldblib.c') diff --git a/ldblib.c b/ldblib.c index 10328f3a..09e1c252 100644 --- a/ldblib.c +++ b/ldblib.c @@ -1,5 +1,5 @@ /* -** $Id: ldblib.c,v 1.135 2013/07/22 16:05:53 roberto Exp roberto $ +** $Id: ldblib.c,v 1.136 2014/02/19 13:51:09 roberto Exp roberto $ ** Interface from Lua to its debug API ** See Copyright Notice in lua.h */ @@ -270,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); -- cgit v1.2.3-55-g6feb