aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lvm.c b/lvm.c
index f0f6df31..86ce5792 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 1.161 2001/01/29 17:16:58 roberto Exp roberto $ 2** $Id: lvm.c,v 1.162 2001/02/01 16:03:38 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*/
@@ -465,12 +465,14 @@ StkId luaV_execute (lua_State *L, const Closure *cl, StkId base) {
465 break; 465 break;
466 } 466 }
467 case OP_SETGLOBAL: { 467 case OP_SETGLOBAL: {
468 L->top = top; /* primitive set may generate an error */
468 luaV_setglobal(L, kstr[GETARG_U(i)], top); 469 luaV_setglobal(L, kstr[GETARG_U(i)], top);
469 top--; 470 top--;
470 break; 471 break;
471 } 472 }
472 case OP_SETTABLE: { 473 case OP_SETTABLE: {
473 StkId t = top-GETARG_A(i); 474 StkId t = top-GETARG_A(i);
475 L->top = top; /* primitive set may generate an error */
474 luaV_settable(L, t, t+1, top); 476 luaV_settable(L, t, t+1, top);
475 top -= GETARG_B(i); /* pop values */ 477 top -= GETARG_B(i); /* pop values */
476 break; 478 break;
@@ -479,6 +481,7 @@ StkId luaV_execute (lua_State *L, const Closure *cl, StkId base) {
479 int aux = GETARG_A(i) * LFIELDS_PER_FLUSH; 481 int aux = GETARG_A(i) * LFIELDS_PER_FLUSH;
480 int n = GETARG_B(i); 482 int n = GETARG_B(i);
481 Hash *arr = hvalue(top-n-1); 483 Hash *arr = hvalue(top-n-1);
484 L->top = top-n;
482 for (; n; n--) 485 for (; n; n--)
483 setobj(luaH_setnum(L, arr, n+aux), --top); 486 setobj(luaH_setnum(L, arr, n+aux), --top);
484 break; 487 break;
@@ -487,6 +490,7 @@ StkId luaV_execute (lua_State *L, const Closure *cl, StkId base) {
487 int n = GETARG_U(i); 490 int n = GETARG_U(i);
488 StkId finaltop = top-2*n; 491 StkId finaltop = top-2*n;
489 Hash *arr = hvalue(finaltop-1); 492 Hash *arr = hvalue(finaltop-1);
493 L->top = finaltop;
490 for (; n; n--) { 494 for (; n; n--) {
491 top-=2; 495 top-=2;
492 setobj(luaH_set(L, arr, top), top+1); 496 setobj(luaH_set(L, arr, top), top+1);