diff options
author | Mike Pall <mike> | 2010-11-17 20:07:55 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-11-17 20:07:55 +0100 |
commit | 3754a8fe7a820bcfc5e2633d15c648a194dd4144 (patch) | |
tree | 77bf743c508c00678ffeabc5ddbbc48ca54427ec /src | |
parent | 751ff5b392be1a556047a90fb846531d429392cf (diff) | |
download | luajit-3754a8fe7a820bcfc5e2633d15c648a194dd4144.tar.gz luajit-3754a8fe7a820bcfc5e2633d15c648a194dd4144.tar.bz2 luajit-3754a8fe7a820bcfc5e2633d15c648a194dd4144.zip |
Allow running C functions with coroutine.create(), too.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib_base.c | 4 | ||||
-rw-r--r-- | src/lib_jit.c | 2 | ||||
-rw-r--r-- | src/lj_errmsg.h | 1 |
3 files changed, 3 insertions, 4 deletions
diff --git a/src/lib_base.c b/src/lib_base.c index 6a842d2c..908099d4 100644 --- a/src/lib_base.c +++ b/src/lib_base.c | |||
@@ -479,8 +479,8 @@ LJLIB_CF(coroutine_running) | |||
479 | LJLIB_CF(coroutine_create) | 479 | LJLIB_CF(coroutine_create) |
480 | { | 480 | { |
481 | lua_State *L1 = lua_newthread(L); | 481 | lua_State *L1 = lua_newthread(L); |
482 | if (!(L->top > L->base && tvisfunc(L->base) && isluafunc(funcV(L->base)))) | 482 | if (!(L->base < L->top && tvisfunc(L->base))) |
483 | lj_err_arg(L, 1, LJ_ERR_NOLFUNC); | 483 | lj_err_argt(L, 1, LUA_TFUNCTION); |
484 | setfuncV(L, L1->top++, funcV(L->base)); | 484 | setfuncV(L, L1->top++, funcV(L->base)); |
485 | return 1; | 485 | return 1; |
486 | } | 486 | } |
diff --git a/src/lib_jit.c b/src/lib_jit.c index 7b2eaf44..3f71ed4d 100644 --- a/src/lib_jit.c +++ b/src/lib_jit.c | |||
@@ -52,7 +52,7 @@ static int setjitmode(lua_State *L, int mode) | |||
52 | if ((mode & LUAJIT_MODE_MASK) == LUAJIT_MODE_ENGINE) | 52 | if ((mode & LUAJIT_MODE_MASK) == LUAJIT_MODE_ENGINE) |
53 | lj_err_caller(L, LJ_ERR_NOJIT); | 53 | lj_err_caller(L, LJ_ERR_NOJIT); |
54 | err: | 54 | err: |
55 | lj_err_arg(L, 1, LJ_ERR_NOLFUNC); | 55 | lj_err_argt(L, 1, LUA_TFUNCTION); |
56 | } | 56 | } |
57 | return 0; | 57 | return 0; |
58 | } | 58 | } |
diff --git a/src/lj_errmsg.h b/src/lj_errmsg.h index 4fe8e1b1..b06a7798 100644 --- a/src/lj_errmsg.h +++ b/src/lj_errmsg.h | |||
@@ -44,7 +44,6 @@ ERRDEF(BADVAL, "invalid value") | |||
44 | ERRDEF(NOVAL, "value expected") | 44 | ERRDEF(NOVAL, "value expected") |
45 | ERRDEF(NOCORO, "coroutine expected") | 45 | ERRDEF(NOCORO, "coroutine expected") |
46 | ERRDEF(NOTABN, "nil or table expected") | 46 | ERRDEF(NOTABN, "nil or table expected") |
47 | ERRDEF(NOLFUNC, "Lua function expected") | ||
48 | ERRDEF(NOFUNCL, "function or level expected") | 47 | ERRDEF(NOFUNCL, "function or level expected") |
49 | ERRDEF(NOSFT, "string/function/table expected") | 48 | ERRDEF(NOSFT, "string/function/table expected") |
50 | ERRDEF(NOPROXY, "boolean or proxy expected") | 49 | ERRDEF(NOPROXY, "boolean or proxy expected") |