aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-02-09 13:59:10 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-02-09 13:59:10 -0200
commitad6c7b0dd4b31965ccf6f1c02448f4c306cc316b (patch)
treee1f3cb627bcf327578bfcbd8cefdf55d66802ae4 /lvm.c
parent8b2d97d1871147c730a986656907837458b601f8 (diff)
downloadlua-ad6c7b0dd4b31965ccf6f1c02448f4c306cc316b.tar.gz
lua-ad6c7b0dd4b31965ccf6f1c02448f4c306cc316b.tar.bz2
lua-ad6c7b0dd4b31965ccf6f1c02448f4c306cc316b.zip
small corrections in opcodes.
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/lvm.c b/lvm.c
index f321cb83..1cc025df 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 1.46 1999/02/08 17:07:59 roberto Exp roberto $ 2** $Id: lvm.c,v 1.47 1999/02/08 18:54:19 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*/
@@ -355,7 +355,14 @@ StkId luaV_execute (Closure *cl, TProtoFunc *tf, StkId base) {
355 case PUSHNUMBERW: aux += highbyte(*pc++); 355 case PUSHNUMBERW: aux += highbyte(*pc++);
356 case PUSHNUMBER: aux += *pc++; 356 case PUSHNUMBER: aux += *pc++;
357 ttype(S->top) = LUA_T_NUMBER; 357 ttype(S->top) = LUA_T_NUMBER;
358 nvalue(S->top) = aux-NUMOFFSET; 358 nvalue(S->top) = aux;
359 S->top++;
360 break;
361
362 case PUSHNEGW: aux += highbyte(*pc++);
363 case PUSHNEG: aux += *pc++;
364 ttype(S->top) = LUA_T_NUMBER;
365 nvalue(S->top) = -aux;
359 S->top++; 366 S->top++;
360 break; 367 break;
361 368
@@ -429,7 +436,7 @@ StkId luaV_execute (Closure *cl, TProtoFunc *tf, StkId base) {
429 S->top -= 2; /* pop table and index */ 436 S->top -= 2; /* pop table and index */
430 break; 437 break;
431 438
432 case SETTABPPDUP: { 439 case SETTABLEPOPDUP: {
433 TObject temp = *(S->top-1); 440 TObject temp = *(S->top-1);
434 luaV_settable(S->top-3); 441 luaV_settable(S->top-3);
435 S->top--; /* pop index (temp goes into "table" position) */ 442 S->top--; /* pop index (temp goes into "table" position) */
@@ -605,7 +612,8 @@ StkId luaV_execute (Closure *cl, TProtoFunc *tf, StkId base) {
605 if (ttype(--S->top) == LUA_T_NIL) pc -= aux; 612 if (ttype(--S->top) == LUA_T_NIL) pc -= aux;
606 break; 613 break;
607 614
608 case CLOSURE: aux = *pc++; 615 case CLOSUREW: aux += highbyte(*pc++);
616 case CLOSURE: aux += *pc++;
609 *S->top++ = consts[aux]; 617 *S->top++ = consts[aux];
610 luaV_closure(*pc++); 618 luaV_closure(*pc++);
611 luaC_checkGC(); 619 luaC_checkGC();