Merge branch 'master' into v2.1

This commit is contained in:
Mike Pall 2013-06-20 16:33:34 +02:00
commit 88188d52f7

View File

@ -408,6 +408,7 @@ static void callback_conv_args(CTState *cts, lua_State *L)
intptr_t *stack = cts->cb.stack; intptr_t *stack = cts->cb.stack;
MSize slot = cts->cb.slot; MSize slot = cts->cb.slot;
CTypeID id = 0, rid, fid; CTypeID id = 0, rid, fid;
int gcsteps = 0;
CType *ct; CType *ct;
GCfunc *fn; GCfunc *fn;
MSize ngpr = 0, nsp = 0, maxgpr = CCALL_NARG_GPR; MSize ngpr = 0, nsp = 0, maxgpr = CCALL_NARG_GPR;
@ -475,7 +476,7 @@ static void callback_conv_args(CTState *cts, lua_State *L)
done: done:
if (LJ_BE && cta->size < CTSIZE_PTR) if (LJ_BE && cta->size < CTSIZE_PTR)
sp = (void *)((uint8_t *)sp + CTSIZE_PTR-cta->size); sp = (void *)((uint8_t *)sp + CTSIZE_PTR-cta->size);
lj_cconv_tv_ct(cts, cta, 0, o++, sp); gcsteps += lj_cconv_tv_ct(cts, cta, 0, o++, sp);
} }
fid = ctf->sib; fid = ctf->sib;
} }
@ -485,6 +486,8 @@ static void callback_conv_args(CTState *cts, lua_State *L)
if (ctype_cconv(ct->info) != CTCC_CDECL) if (ctype_cconv(ct->info) != CTCC_CDECL)
(L->base-2)->u32.hi |= (nsp << (16+2)); (L->base-2)->u32.hi |= (nsp << (16+2));
#endif #endif
while (gcsteps-- > 0)
lj_gc_check(L);
} }
/* Convert Lua object to callback result. */ /* Convert Lua object to callback result. */