diff options
-rw-r--r-- | ltests.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 2.202 2015/01/16 16:54:37 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.203 2015/03/11 16:10:41 roberto Exp roberto $ |
3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -289,11 +289,11 @@ static void checkLclosure (global_State *g, LClosure *cl) { | |||
289 | static int lua_checkpc (lua_State *L, CallInfo *ci) { | 289 | static int lua_checkpc (lua_State *L, CallInfo *ci) { |
290 | if (!isLua(ci)) return 1; | 290 | if (!isLua(ci)) return 1; |
291 | else { | 291 | else { |
292 | Proto *p; | 292 | /* if function yielded (inside a hook), real 'func' is in 'extra' field */ |
293 | if (L->status != LUA_YIELD || ci != L->ci) | 293 | StkId f = (L->status != LUA_YIELD || ci != L->ci) |
294 | p = clLvalue(ci->func)->p; | 294 | ? ci->func |
295 | else /* real 'func' was saved in 'extra' field */ | 295 | : restorestack(L, ci->extra); |
296 | p = clLvalue(restorestack(L, ci->extra))->p; | 296 | Proto *p = clLvalue(f)->p; |
297 | return p->code <= ci->u.l.savedpc && | 297 | return p->code <= ci->u.l.savedpc && |
298 | ci->u.l.savedpc <= p->code + p->sizecode; | 298 | ci->u.l.savedpc <= p->code + p->sizecode; |
299 | } | 299 | } |