summaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/lvm.c b/lvm.c
index 14f6feb3..9c1b13d0 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 1.176 2001/03/07 18:16:22 roberto Exp roberto $ 2** $Id: lvm.c,v 1.177 2001/03/26 14:31:49 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*/
@@ -446,18 +446,19 @@ StkId luaV_execute (lua_State *L, const Closure *cl, StkId base) {
446 } 446 }
447 case OP_SETLIST: { 447 case OP_SETLIST: {
448 int aux = GETARG_A(i) * LFIELDS_PER_FLUSH; 448 int aux = GETARG_A(i) * LFIELDS_PER_FLUSH;
449 int n = GETARG_B(i); 449 TObject *t = base+GETARG_B(i);
450 Hash *arr = hvalue(top-n-1); 450 Hash *h = hvalue(t);
451 for (; n; n--) 451 int n;
452 setobj(luaH_setnum(L, arr, n+aux), --top); 452 for (n = top-t-1; n; n--)
453 setobj(luaH_setnum(L, h, n+aux), --top);
453 break; 454 break;
454 } 455 }
455 case OP_SETMAP: { 456 case OP_SETMAP: {
456 int n = GETARG_U(i); 457 TObject *t = base+GETARG_U(i);
457 Hash *arr = hvalue((top-2*n)-1); 458 Hash *h = hvalue(t);
458 for (; n; n--) { 459 while (top-1 > t) {
459 top-=2; 460 top-=2;
460 setobj(luaH_set(L, arr, top), top+1); 461 setobj(luaH_set(L, h, top), top+1);
461 } 462 }
462 break; 463 break;
463 } 464 }