diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-03-12 17:57:40 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-03-12 17:57:40 -0300 |
commit | a3addae03634794b841b6c8c4dd8ff83542d8896 (patch) | |
tree | 66695864f7bd56c295ad7cd6a6465845103cd424 /ldblib.c | |
parent | ad40bb1181d08821af6789147a28aa8370533d11 (diff) | |
download | lua-a3addae03634794b841b6c8c4dd8ff83542d8896.tar.gz lua-a3addae03634794b841b6c8c4dd8ff83542d8896.tar.bz2 lua-a3addae03634794b841b6c8c4dd8ff83542d8896.zip |
lua_gettable and similars return type of gotten value
Diffstat (limited to 'ldblib.c')
-rw-r--r-- | ldblib.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldblib.c,v 1.135 2013/07/22 16:05:53 roberto Exp roberto $ | 2 | ** $Id: ldblib.c,v 1.136 2014/02/19 13:51:09 roberto Exp roberto $ |
3 | ** Interface from Lua to its debug API | 3 | ** Interface from Lua to its debug API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -270,8 +270,7 @@ static void hookf (lua_State *L, lua_Debug *ar) { | |||
270 | {"call", "return", "line", "count", "tail call"}; | 270 | {"call", "return", "line", "count", "tail call"}; |
271 | gethooktable(L); | 271 | gethooktable(L); |
272 | lua_pushthread(L); | 272 | lua_pushthread(L); |
273 | lua_rawget(L, -2); | 273 | if (lua_rawget(L, -2) == LUA_TFUNCTION) { |
274 | if (lua_isfunction(L, -1)) { | ||
275 | lua_pushstring(L, hooknames[(int)ar->event]); | 274 | lua_pushstring(L, hooknames[(int)ar->event]); |
276 | if (ar->currentline >= 0) | 275 | if (ar->currentline >= 0) |
277 | lua_pushinteger(L, ar->currentline); | 276 | lua_pushinteger(L, ar->currentline); |