diff options
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 2.226 2017/11/01 18:20:48 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.227 2017/11/02 11:28:56 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 | */ |
@@ -310,7 +310,7 @@ static void checkLclosure (global_State *g, LClosure *cl) { | |||
310 | 310 | ||
311 | 311 | ||
312 | static int lua_checkpc (CallInfo *ci) { | 312 | static int lua_checkpc (CallInfo *ci) { |
313 | if (!isLua(ci)) return 1; | 313 | if (!isLua(ci->func)) return 1; |
314 | else { | 314 | else { |
315 | StkId f = ci->func; | 315 | StkId f = ci->func; |
316 | Proto *p = clLvalue(s2v(f))->p; | 316 | Proto *p = clLvalue(s2v(f))->p; |
@@ -327,10 +327,11 @@ static void checkstack (global_State *g, lua_State *L1) { | |||
327 | lua_assert(!isdead(g, L1)); | 327 | lua_assert(!isdead(g, L1)); |
328 | for (uv = L1->openupval; uv != NULL; uv = uv->u.open.next) | 328 | for (uv = L1->openupval; uv != NULL; uv = uv->u.open.next) |
329 | lua_assert(upisopen(uv)); /* must be open */ | 329 | lua_assert(upisopen(uv)); /* must be open */ |
330 | for (ci = L1->ci; ci != NULL; ci = ci->previous) { | 330 | for (ci = L1->ci; ci != NULL; ci = ci->previous) |
331 | lua_assert(ci->top <= L1->stack_last); | ||
332 | lua_assert(lua_checkpc(ci)); | 331 | lua_assert(lua_checkpc(ci)); |
333 | } | 332 | for (o = L1->func; o->stkci.previous != 0; o -= o->stkci.previous) |
333 | lua_assert(functop(o) <= L1->stack_last); | ||
334 | lua_assert(o == L1->stack); | ||
334 | if (L1->stack) { /* complete thread? */ | 335 | if (L1->stack) { /* complete thread? */ |
335 | for (o = L1->stack; o < L1->stack_last + EXTRA_STACK; o++) | 336 | for (o = L1->stack; o < L1->stack_last + EXTRA_STACK; o++) |
336 | checkliveness(L1, s2v(o)); /* entire stack must have valid values */ | 337 | checkliveness(L1, s2v(o)); /* entire stack must have valid values */ |