aboutsummaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-06-29 12:06:44 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-06-29 12:06:44 -0300
commitf96497397addca22f22a6ba6eeabc906be43f16b (patch)
treeaf8d27b9af36dfe0b0b6e0f765ea90b95b110efc /ltests.c
parent5a1c8d8ef343bf0157851a4832c2c937b812b64f (diff)
downloadlua-f96497397addca22f22a6ba6eeabc906be43f16b.tar.gz
lua-f96497397addca22f22a6ba6eeabc906be43f16b.tar.bz2
lua-f96497397addca22f22a6ba6eeabc906be43f16b.zip
new type 'StackValue' for stack elements
(we may want to put extra info there in the future)
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ltests.c b/ltests.c
index 36da64e8..4388e1c9 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 2.221 2017/06/27 11:35:31 roberto Exp roberto $ 2** $Id: ltests.c,v 2.222 2017/06/27 18:32:49 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*/
@@ -46,7 +46,7 @@ void *l_Trick = 0;
46int islocked = 0; 46int islocked = 0;
47 47
48 48
49#define obj_at(L,k) (L->ci->func + (k)) 49#define obj_at(L,k) s2v(L->ci->func + (k))
50 50
51 51
52static int runC (lua_State *L, lua_State *L1, const char *pc); 52static int runC (lua_State *L, lua_State *L1, const char *pc);
@@ -316,7 +316,7 @@ static int lua_checkpc (lua_State *L, CallInfo *ci) {
316 StkId f = (L->status != LUA_YIELD || ci != L->ci) 316 StkId f = (L->status != LUA_YIELD || ci != L->ci)
317 ? ci->func 317 ? ci->func
318 : restorestack(L, ci->extra); 318 : restorestack(L, ci->extra);
319 Proto *p = clLvalue(f)->p; 319 Proto *p = clLvalue(s2v(f))->p;
320 return p->code <= ci->u.l.savedpc && 320 return p->code <= ci->u.l.savedpc &&
321 ci->u.l.savedpc <= p->code + p->sizecode; 321 ci->u.l.savedpc <= p->code + p->sizecode;
322 } 322 }
@@ -336,7 +336,7 @@ static void checkstack (global_State *g, lua_State *L1) {
336 } 336 }
337 if (L1->stack) { /* complete thread? */ 337 if (L1->stack) { /* complete thread? */
338 for (o = L1->stack; o < L1->stack_last + EXTRA_STACK; o++) 338 for (o = L1->stack; o < L1->stack_last + EXTRA_STACK; o++)
339 checkliveness(L1, o); /* entire stack must have valid values */ 339 checkliveness(L1, s2v(o)); /* entire stack must have valid values */
340 } 340 }
341 else lua_assert(L1->stacksize == 0); 341 else lua_assert(L1->stacksize == 0);
342} 342}