diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-05-23 09:50:11 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-05-23 09:50:11 -0300 |
| commit | c25380c28da154b271d91543e61e27ae974e9ecc (patch) | |
| tree | 313eaeaee708cd32cd32ba9ffd58872adc5ca0f4 | |
| parent | 03094da80cc8e501cc33f1f3e37bf8536556b4e9 (diff) | |
| download | lua-c25380c28da154b271d91543e61e27ae974e9ecc.tar.gz lua-c25380c28da154b271d91543e61e27ae974e9ecc.tar.bz2 lua-c25380c28da154b271d91543e61e27ae974e9ecc.zip | |
details (using proper version of 'setobj')
| -rw-r--r-- | ldo.c | 4 | ||||
| -rw-r--r-- | lvm.c | 6 |
2 files changed, 5 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldo.c,v 2.158 2017/05/13 12:57:20 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 2.159 2017/05/13 13:54:47 roberto Exp roberto $ |
| 3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -116,7 +116,7 @@ l_noret luaD_throw (lua_State *L, int errcode) { | |||
| 116 | global_State *g = G(L); | 116 | global_State *g = G(L); |
| 117 | L->status = cast_byte(errcode); /* mark it as dead */ | 117 | L->status = cast_byte(errcode); /* mark it as dead */ |
| 118 | if (g->mainthread->errorJmp) { /* main thread has a handler? */ | 118 | if (g->mainthread->errorJmp) { /* main thread has a handler? */ |
| 119 | setobjs2s(L, g->mainthread->top++, L->top - 1); /* copy error obj. */ | 119 | setobj2s(L, g->mainthread->top++, L->top - 1); /* copy error obj. */ |
| 120 | luaD_throw(g->mainthread, errcode); /* re-throw in main thread */ | 120 | luaD_throw(g->mainthread, errcode); /* re-throw in main thread */ |
| 121 | } | 121 | } |
| 122 | else { /* no handler at all; abort */ | 122 | else { /* no handler at all; abort */ |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lvm.c,v 2.283 2017/05/18 19:34:39 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.284 2017/05/18 19:44: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 | */ |
| @@ -690,13 +690,13 @@ void luaV_finishOp (lua_State *L) { | |||
| 690 | StkId top = L->top - 1; /* top when 'luaT_trybinTM' was called */ | 690 | StkId top = L->top - 1; /* top when 'luaT_trybinTM' was called */ |
| 691 | int b = GETARG_B(inst); /* first element to concatenate */ | 691 | int b = GETARG_B(inst); /* first element to concatenate */ |
| 692 | int total = cast_int(top - 1 - (base + b)); /* yet to concatenate */ | 692 | int total = cast_int(top - 1 - (base + b)); /* yet to concatenate */ |
| 693 | setobj2s(L, top - 2, top); /* put TM result in proper position */ | 693 | setobjs2s(L, top - 2, top); /* put TM result in proper position */ |
| 694 | if (total > 1) { /* are there elements to concat? */ | 694 | if (total > 1) { /* are there elements to concat? */ |
| 695 | L->top = top - 1; /* top is one after last element (at top-2) */ | 695 | L->top = top - 1; /* top is one after last element (at top-2) */ |
| 696 | luaV_concat(L, total); /* concat them (may yield again) */ | 696 | luaV_concat(L, total); /* concat them (may yield again) */ |
| 697 | } | 697 | } |
| 698 | /* move final result to final position */ | 698 | /* move final result to final position */ |
| 699 | setobj2s(L, ci->func + 1 + GETARG_A(inst), L->top - 1); | 699 | setobjs2s(L, ci->func + 1 + GETARG_A(inst), L->top - 1); |
| 700 | L->top = ci->top; /* restore top */ | 700 | L->top = ci->top; /* restore top */ |
| 701 | break; | 701 | break; |
| 702 | } | 702 | } |
