diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-03-07 15:27:34 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-03-07 15:27:34 -0300 |
commit | e010ef8948b46b19395a938ebc2a1612de420dd5 (patch) | |
tree | 733fb8ea42d568ee3ccbaf869321b44b08f4221e /lvm.c | |
parent | 1e48b20ce014c58c639f2d9034f41493bc87d7f1 (diff) | |
download | lua-e010ef8948b46b19395a938ebc2a1612de420dd5.tar.gz lua-e010ef8948b46b19395a938ebc2a1612de420dd5.tar.bz2 lua-e010ef8948b46b19395a938ebc2a1612de420dd5.zip |
detail
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.26 2005/02/23 17:30:22 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.27 2005/03/07 16:59:01 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 | */ |
@@ -354,7 +354,7 @@ static StkId Arith (lua_State *L, StkId ra, const TValue *rb, | |||
354 | ** some macros for common tasks in `luaV_execute' | 354 | ** some macros for common tasks in `luaV_execute' |
355 | */ | 355 | */ |
356 | 356 | ||
357 | #define runtime_check(L, c) { if (!(c)) return 0; } | 357 | #define runtime_check(L, c) { if (!(c)) break; } |
358 | 358 | ||
359 | #define RA(i) (base+GETARG_A(i)) | 359 | #define RA(i) (base+GETARG_A(i)) |
360 | /* to be used after possible stack reallocation */ | 360 | /* to be used after possible stack reallocation */ |
@@ -717,13 +717,13 @@ StkId luaV_execute (lua_State *L, int nexeccalls) { | |||
717 | int c = GETARG_C(i); | 717 | int c = GETARG_C(i); |
718 | int last; | 718 | int last; |
719 | Table *h; | 719 | Table *h; |
720 | runtime_check(L, ttistable(ra)); | ||
721 | h = hvalue(ra); | ||
722 | if (n == 0) { | 720 | if (n == 0) { |
723 | n = L->top - ra - 1; | 721 | n = L->top - ra - 1; |
724 | L->top = L->ci->top; | 722 | L->top = L->ci->top; |
725 | } | 723 | } |
726 | if (c == 0) c = cast(int, *pc++); | 724 | if (c == 0) c = cast(int, *pc++); |
725 | runtime_check(L, ttistable(ra)); | ||
726 | h = hvalue(ra); | ||
727 | last = ((c-1)*LFIELDS_PER_FLUSH) + n + LUA_FIRSTINDEX - 1; | 727 | last = ((c-1)*LFIELDS_PER_FLUSH) + n + LUA_FIRSTINDEX - 1; |
728 | if (last > h->sizearray) /* needs more space? */ | 728 | if (last > h->sizearray) /* needs more space? */ |
729 | luaH_resizearray(L, h, last); /* pre-alloc it at once */ | 729 | luaH_resizearray(L, h, last); /* pre-alloc it at once */ |