diff options
author | Mike Pall <mike> | 2012-04-12 12:02:38 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2012-04-12 12:02:38 +0200 |
commit | 68ca796d28f616f38a376ed1bb1a3de29d1b1200 (patch) | |
tree | 1bc30d93af980f5cd2b9809ced05d73811cc94ee /src/lj_meta.c | |
parent | 3ed5172fe49ab9cd08e803c3bec1fc29492e24fe (diff) | |
download | luajit-68ca796d28f616f38a376ed1bb1a3de29d1b1200.tar.gz luajit-68ca796d28f616f38a376ed1bb1a3de29d1b1200.tar.bz2 luajit-68ca796d28f616f38a376ed1bb1a3de29d1b1200.zip |
Make lua_concat() work from C hook with partial frame.
Diffstat (limited to 'src/lj_meta.c')
-rw-r--r-- | src/lj_meta.c | 7 |
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. */ |
241 | TValue *lj_meta_cat(lua_State *L, TValue *top, int left) | 241 | TValue *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 | ||