diff options
| author | Mike Pall <mike> | 2013-05-29 14:54:06 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2013-05-29 14:54:06 +0200 |
| commit | 6850d795b61ed726e4038327d5ebf4627330852f (patch) | |
| tree | f54eac9fd37308003a0452df503a34e3493fae01 /src | |
| parent | 26e4287e60f636af93493ccb16b7173110db9087 (diff) | |
| download | luajit-6850d795b61ed726e4038327d5ebf4627330852f.tar.gz luajit-6850d795b61ed726e4038327d5ebf4627330852f.tar.bz2 luajit-6850d795b61ed726e4038327d5ebf4627330852f.zip | |
Minor change to lj_lib_pushcc().
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib_base.c | 5 | ||||
| -rw-r--r-- | src/lj_lib.h | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/lib_base.c b/src/lib_base.c index 44817187..1665faee 100644 --- a/src/lib_base.c +++ b/src/lib_base.c | |||
| @@ -619,9 +619,10 @@ static void setpc_wrap_aux(lua_State *L, GCfunc *fn); | |||
| 619 | 619 | ||
| 620 | LJLIB_CF(coroutine_wrap) | 620 | LJLIB_CF(coroutine_wrap) |
| 621 | { | 621 | { |
| 622 | GCfunc *fn; | ||
| 622 | lj_cf_coroutine_create(L); | 623 | lj_cf_coroutine_create(L); |
| 623 | lj_lib_pushcc(L, lj_ffh_coroutine_wrap_aux, FF_coroutine_wrap_aux, 1); | 624 | fn = lj_lib_pushcc(L, lj_ffh_coroutine_wrap_aux, FF_coroutine_wrap_aux, 1); |
| 624 | setpc_wrap_aux(L, funcV(L->top-1)); | 625 | setpc_wrap_aux(L, fn); |
| 625 | return 1; | 626 | return 1; |
| 626 | } | 627 | } |
| 627 | 628 | ||
diff --git a/src/lj_lib.h b/src/lj_lib.h index 2dd45adb..463bfb60 100644 --- a/src/lj_lib.h +++ b/src/lj_lib.h | |||
| @@ -60,14 +60,15 @@ LJ_FUNC int lj_lib_checkopt(lua_State *L, int narg, int def, const char *lst); | |||
| 60 | #endif | 60 | #endif |
| 61 | 61 | ||
| 62 | /* Push internal function on the stack. */ | 62 | /* Push internal function on the stack. */ |
| 63 | static LJ_AINLINE void lj_lib_pushcc(lua_State *L, lua_CFunction f, | 63 | static LJ_AINLINE GCfunc *lj_lib_pushcc(lua_State *L, lua_CFunction f, |
| 64 | int id, int n) | 64 | int id, int n) |
| 65 | { | 65 | { |
| 66 | GCfunc *fn; | 66 | GCfunc *fn; |
| 67 | lua_pushcclosure(L, f, n); | 67 | lua_pushcclosure(L, f, n); |
| 68 | fn = funcV(L->top-1); | 68 | fn = funcV(L->top-1); |
| 69 | fn->c.ffid = (uint8_t)id; | 69 | fn->c.ffid = (uint8_t)id; |
| 70 | setmref(fn->c.pc, &G(L)->bc_cfunc_int); | 70 | setmref(fn->c.pc, &G(L)->bc_cfunc_int); |
| 71 | return fn; | ||
| 71 | } | 72 | } |
| 72 | 73 | ||
| 73 | #define lj_lib_pushcf(L, fn, id) (lj_lib_pushcc(L, (fn), (id), 0)) | 74 | #define lj_lib_pushcf(L, fn, id) (lj_lib_pushcc(L, (fn), (id), 0)) |
