diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-04-18 16:48:53 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-04-18 16:48:53 -0300 |
commit | 05ca63642bacfee1871726ee69a2a66fe4b76dd1 (patch) | |
tree | 0758e4faff453f51a43a97784452088b6810b856 | |
parent | f17e3624ef45212828458c9832306fefb7fc9a6b (diff) | |
download | lua-05ca63642bacfee1871726ee69a2a66fe4b76dd1.tar.gz lua-05ca63642bacfee1871726ee69a2a66fe4b76dd1.tar.bz2 lua-05ca63642bacfee1871726ee69a2a66fe4b76dd1.zip |
added macro for code checking
-rw-r--r-- | lvm.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.133 2011/04/05 18:32:06 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.134 2011/04/07 18:14:12 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -454,6 +454,11 @@ void luaV_finishOp (lua_State *L) { | |||
454 | ** some macros for common tasks in `luaV_execute' | 454 | ** some macros for common tasks in `luaV_execute' |
455 | */ | 455 | */ |
456 | 456 | ||
457 | #if !defined luai_runtimecheck | ||
458 | #define luai_runtimecheck(L, c) /* void */ | ||
459 | #endif | ||
460 | |||
461 | |||
457 | #define RA(i) (base+GETARG_A(i)) | 462 | #define RA(i) (base+GETARG_A(i)) |
458 | /* to be used after possible stack reallocation */ | 463 | /* to be used after possible stack reallocation */ |
459 | #define RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i)) | 464 | #define RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i)) |
@@ -788,6 +793,7 @@ void luaV_execute (lua_State *L) { | |||
788 | lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_EXTRAARG); | 793 | lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_EXTRAARG); |
789 | c = GETARG_Ax(*ci->u.l.savedpc++); | 794 | c = GETARG_Ax(*ci->u.l.savedpc++); |
790 | } | 795 | } |
796 | luai_runtimecheck(L, ttistable(ra)); | ||
791 | h = hvalue(ra); | 797 | h = hvalue(ra); |
792 | last = ((c-1)*LFIELDS_PER_FLUSH) + n; | 798 | last = ((c-1)*LFIELDS_PER_FLUSH) + n; |
793 | if (last > h->sizearray) /* needs more space? */ | 799 | if (last > h->sizearray) /* needs more space? */ |