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/lib_base.c | |
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/lib_base.c')
-rw-r--r-- | src/lib_base.c | 4 |
1 files changed, 2 insertions, 2 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 | } |