diff options
Diffstat (limited to '')
| -rw-r--r-- | lvm.c | 16 |
1 files changed, 9 insertions, 7 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lvm.c,v 1.55 1999/04/13 19:28:49 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 1.56 1999/05/21 17:23:15 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 | */ |
| @@ -214,7 +214,8 @@ void luaV_setglobal (TaggedString *ts) { | |||
| 214 | else { | 214 | else { |
| 215 | /* WARNING: caller must assure stack space */ | 215 | /* WARNING: caller must assure stack space */ |
| 216 | struct Stack *S = &L->stack; | 216 | struct Stack *S = &L->stack; |
| 217 | TObject newvalue = *(S->top-1); | 217 | TObject newvalue; |
| 218 | newvalue = *(S->top-1); | ||
| 218 | ttype(S->top-1) = LUA_T_STRING; | 219 | ttype(S->top-1) = LUA_T_STRING; |
| 219 | tsvalue(S->top-1) = ts; | 220 | tsvalue(S->top-1) = ts; |
| 220 | *S->top++ = *oldvalue; | 221 | *S->top++ = *oldvalue; |
| @@ -403,7 +404,8 @@ StkId luaV_execute (Closure *cl, TProtoFunc *tf, StkId base) { | |||
| 403 | 404 | ||
| 404 | case PUSHSELFW: aux += highbyte(*pc++); | 405 | case PUSHSELFW: aux += highbyte(*pc++); |
| 405 | case PUSHSELF: aux += *pc++; { | 406 | case PUSHSELF: aux += *pc++; { |
| 406 | TObject receiver = *(S->top-1); | 407 | TObject receiver; |
| 408 | receiver = *(S->top-1); | ||
| 407 | *S->top++ = consts[aux]; | 409 | *S->top++ = consts[aux]; |
| 408 | luaV_gettable(); | 410 | luaV_gettable(); |
| 409 | *S->top++ = receiver; | 411 | *S->top++ = receiver; |
| @@ -439,17 +441,17 @@ StkId luaV_execute (Closure *cl, TProtoFunc *tf, StkId base) { | |||
| 439 | case SETLISTW: aux += highbyte(*pc++); | 441 | case SETLISTW: aux += highbyte(*pc++); |
| 440 | case SETLIST: aux += *pc++; { | 442 | case SETLIST: aux += *pc++; { |
| 441 | int n = *(pc++); | 443 | int n = *(pc++); |
| 442 | TObject *arr = S->top-n-1; | 444 | Hash *arr = avalue(S->top-n-1); |
| 443 | aux *= LFIELDS_PER_FLUSH; | 445 | aux *= LFIELDS_PER_FLUSH; |
| 444 | for (; n; n--) | 446 | for (; n; n--) |
| 445 | luaH_setint(avalue(arr), n+aux, --S->top); | 447 | luaH_setint(arr, n+aux, --S->top); |
| 446 | break; | 448 | break; |
| 447 | } | 449 | } |
| 448 | 450 | ||
| 449 | case SETMAP: aux = *pc++; { | 451 | case SETMAP: aux = *pc++; { |
| 450 | TObject *arr = S->top-(2*aux)-3; | 452 | Hash *arr = avalue(S->top-(2*aux)-3); |
| 451 | do { | 453 | do { |
| 452 | luaH_set(avalue(arr), S->top-2, S->top-1); | 454 | luaH_set(arr, S->top-2, S->top-1); |
| 453 | S->top-=2; | 455 | S->top-=2; |
| 454 | } while (aux--); | 456 | } while (aux--); |
| 455 | break; | 457 | break; |
