mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Minor change to lj_lib_pushcc().
This commit is contained in:
parent
26e4287e60
commit
6850d795b6
@ -619,9 +619,10 @@ static void setpc_wrap_aux(lua_State *L, GCfunc *fn);
|
||||
|
||||
LJLIB_CF(coroutine_wrap)
|
||||
{
|
||||
GCfunc *fn;
|
||||
lj_cf_coroutine_create(L);
|
||||
lj_lib_pushcc(L, lj_ffh_coroutine_wrap_aux, FF_coroutine_wrap_aux, 1);
|
||||
setpc_wrap_aux(L, funcV(L->top-1));
|
||||
fn = lj_lib_pushcc(L, lj_ffh_coroutine_wrap_aux, FF_coroutine_wrap_aux, 1);
|
||||
setpc_wrap_aux(L, fn);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -60,14 +60,15 @@ LJ_FUNC int lj_lib_checkopt(lua_State *L, int narg, int def, const char *lst);
|
||||
#endif
|
||||
|
||||
/* Push internal function on the stack. */
|
||||
static LJ_AINLINE void lj_lib_pushcc(lua_State *L, lua_CFunction f,
|
||||
int id, int n)
|
||||
static LJ_AINLINE GCfunc *lj_lib_pushcc(lua_State *L, lua_CFunction f,
|
||||
int id, int n)
|
||||
{
|
||||
GCfunc *fn;
|
||||
lua_pushcclosure(L, f, n);
|
||||
fn = funcV(L->top-1);
|
||||
fn->c.ffid = (uint8_t)id;
|
||||
setmref(fn->c.pc, &G(L)->bc_cfunc_int);
|
||||
return fn;
|
||||
}
|
||||
|
||||
#define lj_lib_pushcf(L, fn, id) (lj_lib_pushcc(L, (fn), (id), 0))
|
||||
|
Loading…
Reference in New Issue
Block a user