aboutsummaryrefslogtreecommitdiff
path: root/ldebug.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-02-07 16:13:49 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-02-07 16:13:49 -0200
commit7178a5e34aa56c09a01a6664bb7a61c6771700d4 (patch)
tree318a1dd14cd5a0497229183e56e29198b3b2016c /ldebug.c
parent322b7b5fc55da0d166efc693cfe674220190b010 (diff)
downloadlua-7178a5e34aa56c09a01a6664bb7a61c6771700d4.tar.gz
lua-7178a5e34aa56c09a01a6664bb7a61c6771700d4.tar.bz2
lua-7178a5e34aa56c09a01a6664bb7a61c6771700d4.zip
new way to handle top x L->top
Diffstat (limited to 'ldebug.c')
-rw-r--r--ldebug.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/ldebug.c b/ldebug.c
index 0cb93494..a54b293c 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.c,v 1.58 2001/01/29 17:16:58 roberto Exp roberto $ 2** $Id: ldebug.c,v 1.59 2001/02/02 15:13:05 roberto Exp roberto $
3** Debug Interface 3** Debug Interface
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -397,10 +397,12 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int stackpos) {
397 } 397 }
398 default: { 398 default: {
399 OpCode op = GET_OPCODE(i); 399 OpCode op = GET_OPCODE(i);
400 lua_assert(luaK_opproperties[op].push != VD); 400 int push = (int)luaK_opproperties[op].push;
401 top -= (int)luaK_opproperties[op].pop; 401 int pop = (int)luaK_opproperties[op].pop;
402 lua_assert(top >= 0); 402 lua_assert(push != VD && pop != VD);
403 top = pushpc(stack, pc, top, luaK_opproperties[op].push); 403 lua_assert(0 <= top-pop && top+push <= pt->maxstacksize);
404 top -= pop;
405 top = pushpc(stack, pc, top, push);
404 } 406 }
405 } 407 }
406 } 408 }
@@ -482,9 +484,9 @@ void luaG_binerror (lua_State *L, StkId p1, int t, const char *op) {
482} 484}
483 485
484 486
485void luaG_ordererror (lua_State *L, StkId top) { 487void luaG_ordererror (lua_State *L, const TObject *p1, const TObject *p2) {
486 const char *t1 = luaT_typename(G(L), top-2); 488 const char *t1 = luaT_typename(G(L), p1);
487 const char *t2 = luaT_typename(G(L), top-1); 489 const char *t2 = luaT_typename(G(L), p2);
488 if (t1[2] == t2[2]) 490 if (t1[2] == t2[2])
489 luaO_verror(L, "attempt to compare two %.10s values", t1); 491 luaO_verror(L, "attempt to compare two %.10s values", t1);
490 else 492 else