From 05ca63642bacfee1871726ee69a2a66fe4b76dd1 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 18 Apr 2011 16:48:53 -0300 Subject: [PATCH] added macro for code checking --- lvm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lvm.c b/lvm.c index 3d0138be..7356a398 100644 --- a/lvm.c +++ b/lvm.c @@ -1,5 +1,5 @@ /* -** $Id: lvm.c,v 2.133 2011/04/05 18:32:06 roberto Exp roberto $ +** $Id: lvm.c,v 2.134 2011/04/07 18:14:12 roberto Exp roberto $ ** Lua virtual machine ** See Copyright Notice in lua.h */ @@ -454,6 +454,11 @@ void luaV_finishOp (lua_State *L) { ** some macros for common tasks in `luaV_execute' */ +#if !defined luai_runtimecheck +#define luai_runtimecheck(L, c) /* void */ +#endif + + #define RA(i) (base+GETARG_A(i)) /* to be used after possible stack reallocation */ #define RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i)) @@ -788,6 +793,7 @@ void luaV_execute (lua_State *L) { lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_EXTRAARG); c = GETARG_Ax(*ci->u.l.savedpc++); } + luai_runtimecheck(L, ttistable(ra)); h = hvalue(ra); last = ((c-1)*LFIELDS_PER_FLUSH) + n; if (last > h->sizearray) /* needs more space? */