diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-04-06 15:25:00 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-04-06 15:25:00 -0300 |
commit | a68635a919c5541b6acf5c2e8da5f81c67b65a7a (patch) | |
tree | e18acd4fc3fd6abdca5d3f8611e97015fd7bda0e /lvm.c | |
parent | 211214268065ec61180141d336e02393bc15bce4 (diff) | |
download | lua-a68635a919c5541b6acf5c2e8da5f81c67b65a7a.tar.gz lua-a68635a919c5541b6acf5c2e8da5f81c67b65a7a.tar.bz2 lua-a68635a919c5541b6acf5c2e8da5f81c67b65a7a.zip |
list constructors do not adjust last expression
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -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 | } |