diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-02-08 16:54:19 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-02-08 16:54:19 -0200 |
commit | 8b2d97d1871147c730a986656907837458b601f8 (patch) | |
tree | d555c67380642b973a43d04fcfbbfdb3588e12da /lvm.c | |
parent | fb1cf6ab2d12bd61e3d429830ab20d4ff3c39fd9 (diff) | |
download | lua-8b2d97d1871147c730a986656907837458b601f8.tar.gz lua-8b2d97d1871147c730a986656907837458b601f8.tar.bz2 lua-8b2d97d1871147c730a986656907837458b601f8.zip |
assignment expression may be multiple
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 33 |
1 files changed, 22 insertions, 11 deletions
@@ -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++); |