diff options
Diffstat (limited to '')
| -rw-r--r-- | lvm.c | 4 |
1 files changed, 3 insertions, 1 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lvm.c,v 2.78 2008/10/28 16:53:16 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.79 2008/10/30 15:39:30 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 | */ |
| @@ -271,8 +271,10 @@ void luaV_concat (lua_State *L, int total, int last) { | |||
| 271 | StkId top = L->base + last + 1; | 271 | StkId top = L->base + last + 1; |
| 272 | int n = 2; /* number of elements handled in this pass (at least 2) */ | 272 | int n = 2; /* number of elements handled in this pass (at least 2) */ |
| 273 | if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) { | 273 | if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) { |
| 274 | L->top = top; /* set top to current position (in case of yield) */ | ||
| 274 | if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT)) | 275 | if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT)) |
| 275 | luaG_concaterror(L, top-2, top-1); | 276 | luaG_concaterror(L, top-2, top-1); |
| 277 | L->top = L->ci->top; /* restore top */ | ||
| 276 | } | 278 | } |
| 277 | else if (tsvalue(top-1)->len == 0) { /* second operand is empty? */ | 279 | else if (tsvalue(top-1)->len == 0) { /* second operand is empty? */ |
| 278 | (void)tostring(L, top - 2); /* result is first operand */ ; | 280 | (void)tostring(L, top - 2); /* result is first operand */ ; |
