aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-06-13 11:39:19 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-06-13 11:39:19 -0300
commit3c2cf9db672bb18dde960ec445a3c98c56435f98 (patch)
treec1a55696de7cbefd109cd05da70d7d5405c5abbb
parent0b71bfd6af466b2f195545a9348c9ba5c5d40dcc (diff)
downloadlua-3c2cf9db672bb18dde960ec445a3c98c56435f98.tar.gz
lua-3c2cf9db672bb18dde960ec445a3c98c56435f98.tar.bz2
lua-3c2cf9db672bb18dde960ec445a3c98c56435f98.zip
some extra consistency checks
-rw-r--r--ldebug.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ldebug.c b/ldebug.c
index a6fa2b58..cc14486b 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldebug.c,v 2.21 2005/05/31 14:25:18 roberto Exp roberto $ 2** $Id: ldebug.c,v 2.22 2005/06/13 14:15:54 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*/
@@ -275,8 +275,11 @@ LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {
275 275
276static int precheck (const Proto *pt) { 276static int precheck (const Proto *pt) {
277 check(pt->maxstacksize <= MAXSTACK); 277 check(pt->maxstacksize <= MAXSTACK);
278 check(pt->sizelineinfo == pt->sizecode || pt->sizelineinfo == 0);
279 lua_assert(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize); 278 lua_assert(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize);
279 lua_assert(!(pt->is_vararg & VARARG_NEEDSARG) ||
280 (pt->is_vararg & VARARG_HASARG));
281 check(pt->sizeupvalues <= pt->nups);
282 check(pt->sizelineinfo == pt->sizecode || pt->sizelineinfo == 0);
280 check(GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN); 283 check(GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN);
281 return 1; 284 return 1;
282} 285}