diff options
Diffstat (limited to '')
-rw-r--r-- | lapi.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1286,13 +1286,14 @@ LUA_API void lua_toclose (lua_State *L, int idx) { | |||
1286 | LUA_API void lua_concat (lua_State *L, int n) { | 1286 | LUA_API void lua_concat (lua_State *L, int n) { |
1287 | lua_lock(L); | 1287 | lua_lock(L); |
1288 | api_checknelems(L, n); | 1288 | api_checknelems(L, n); |
1289 | if (n > 0) | 1289 | if (n > 0) { |
1290 | luaV_concat(L, n); | 1290 | luaV_concat(L, n); |
1291 | luaC_checkGC(L); | ||
1292 | } | ||
1291 | else { /* nothing to concatenate */ | 1293 | else { /* nothing to concatenate */ |
1292 | setsvalue2s(L, L->top.p, luaS_newlstr(L, "", 0)); /* push empty string */ | 1294 | setsvalue2s(L, L->top.p, luaS_newlstr(L, "", 0)); /* push empty string */ |
1293 | api_incr_top(L); | 1295 | api_incr_top(L); |
1294 | } | 1296 | } |
1295 | luaC_checkGC(L); | ||
1296 | lua_unlock(L); | 1297 | lua_unlock(L); |
1297 | } | 1298 | } |
1298 | 1299 | ||