aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/lvm.c b/lvm.c
index 6dc34dd4..f321cb83 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 1.45 1999/02/04 17:47:59 roberto Exp roberto $ 2** $Id: lvm.c,v 1.46 1999/02/08 17:07:59 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*/
@@ -344,7 +344,12 @@ StkId luaV_execute (Closure *cl, TProtoFunc *tf, StkId base) {
344 break; 344 break;
345 345
346 case POP: aux = *pc++; 346 case POP: aux = *pc++;
347 S->top -= (aux+1); 347 S->top -= aux;
348 break;
349
350 case POPDUP: aux = *pc++;
351 *(S->top-aux-1) = *(S->top-1);
352 S->top -= aux;
348 break; 353 break;
349 354
350 case PUSHNUMBERW: aux += highbyte(*pc++); 355 case PUSHNUMBERW: aux += highbyte(*pc++);
@@ -420,22 +425,28 @@ StkId luaV_execute (Closure *cl, TProtoFunc *tf, StkId base) {
420 break; 425 break;
421 426
422 case SETTABLEPOP: 427 case SETTABLEPOP:
423 luaV_settable(S->top-3); 428 luaV_settable(S->top-3);
424 S->top -= 2; /* pop table and index */ 429 S->top -= 2; /* pop table and index */
425 break; 430 break;
426 431
427 case SETTABPPDUP: { 432 case SETTABPPDUP: {
428 TObject temp = *(S->top-1); 433 TObject temp = *(S->top-1);
429 luaV_settable(S->top-3); 434 luaV_settable(S->top-3);
430 S->top--; /* pop index (temp goes into "table" position) */ 435 S->top--; /* pop index (temp goes into "table" position) */
431 *(S->top-1) = temp; 436 *(S->top-1) = temp;
432 break; 437 break;
433 } 438 }
434 439
435 case SETTABLE: 440 case SETTABLE:
436 luaV_settable(S->top-3-(*pc++)); 441 luaV_settable(S->top-3-(*pc++));
437 break; 442 break;
438 443
444 case SETTABLEDUP:
445 *S->top = *(S->top-1);
446 S->top++;
447 luaV_settable(S->top-(3+1)-(*pc++));
448 break;
449
439 case SETLISTW: aux += highbyte(*pc++); 450 case SETLISTW: aux += highbyte(*pc++);
440 case SETLIST: aux += *pc++; { 451 case SETLIST: aux += *pc++; {
441 int n = *(pc++); 452 int n = *(pc++);