aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-01-04 13:55:12 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-01-04 13:55:12 -0200
commit65726f3e2e226f6a350a5dba643c13c8edd34965 (patch)
treea65e8ac39cb13cbafdfc6870ffaea248e96b25ba /lvm.c
parent9fe2d0266ac3ba30d432ca8edf6116beb94fe2af (diff)
downloadlua-65726f3e2e226f6a350a5dba643c13c8edd34965.tar.gz
lua-65726f3e2e226f6a350a5dba643c13c8edd34965.tar.bz2
lua-65726f3e2e226f6a350a5dba643c13c8edd34965.zip
cleaner interface to `ltable'
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lvm.c b/lvm.c
index d98fcc7c..52c5b4c1 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 2.17 2004/11/01 15:06:50 roberto Exp roberto $ 2** $Id: lvm.c,v 2.18 2004/12/03 20:35:33 roberto Exp $
3** Lua virtual machine 3** Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -461,8 +461,8 @@ StkId luaV_execute (lua_State *L, int nexeccalls) {
461 } 461 }
462 case OP_NEWTABLE: { 462 case OP_NEWTABLE: {
463 int b = GETARG_B(i); 463 int b = GETARG_B(i);
464 b = luaO_fb2int(b); 464 int c = GETARG_C(i);
465 sethvalue(L, ra, luaH_new(L, b, GETARG_C(i))); 465 sethvalue(L, ra, luaH_new(L, luaO_fb2int(b), luaO_fb2int(c) - 1));
466 L->ci->savedpc = pc; 466 L->ci->savedpc = pc;
467 luaC_checkGC(L); /***/ 467 luaC_checkGC(L); /***/
468 base = L->base; 468 base = L->base;
@@ -723,7 +723,7 @@ StkId luaV_execute (lua_State *L, int nexeccalls) {
723 if (c == 0) c = cast(int, *pc++); 723 if (c == 0) c = cast(int, *pc++);
724 last = ((c-1)*LFIELDS_PER_FLUSH) + n + LUA_FIRSTINDEX - 1; 724 last = ((c-1)*LFIELDS_PER_FLUSH) + n + LUA_FIRSTINDEX - 1;
725 if (last > h->sizearray) /* needs more space? */ 725 if (last > h->sizearray) /* needs more space? */
726 luaH_resize(L, h, last, h->lsizenode); /* pre-alloc it at once */ 726 luaH_resizearray(L, h, last); /* pre-alloc it at once */
727 for (; n > 0; n--) { 727 for (; n > 0; n--) {
728 TValue *val = ra+n; 728 TValue *val = ra+n;
729 setobj2t(L, luaH_setnum(L, h, last--), val); 729 setobj2t(L, luaH_setnum(L, h, last--), val);