summaryrefslogtreecommitdiff
path: root/src/lj_meta.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_meta.c')
-rw-r--r--src/lj_meta.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lj_meta.c b/src/lj_meta.c
index 4c4bf49d..ab8099e8 100644
--- a/src/lj_meta.c
+++ b/src/lj_meta.c
@@ -240,6 +240,8 @@ static LJ_AINLINE int tostring(lua_State *L, TValue *o)
240/* Helper for CAT. Coercion, iterative concat, __concat metamethod. */ 240/* Helper for CAT. Coercion, iterative concat, __concat metamethod. */
241TValue *lj_meta_cat(lua_State *L, TValue *top, int left) 241TValue *lj_meta_cat(lua_State *L, TValue *top, int left)
242{ 242{
243 int fromc = 0;
244 if (left < 0) { left = -left; fromc = 1; }
243 do { 245 do {
244 int n = 1; 246 int n = 1;
245 if (!(tvisstr(top-1) || tvisnumber(top-1)) || !tostring(L, top)) { 247 if (!(tvisstr(top-1) || tvisnumber(top-1)) || !tostring(L, top)) {
@@ -300,7 +302,10 @@ TValue *lj_meta_cat(lua_State *L, TValue *top, int left)
300 left -= n; 302 left -= n;
301 top -= n; 303 top -= n;
302 } while (left >= 1); 304 } while (left >= 1);
303 lj_gc_check_fixtop(L); 305 if (LJ_UNLIKELY(G(L)->gc.total >= G(L)->gc.threshold)) {
306 if (!fromc) L->top = curr_topL(L);
307 lj_gc_step(L);
308 }
304 return NULL; 309 return NULL;
305} 310}
306 311