aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib_base.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib_base.c b/src/lib_base.c
index 746a4fd6..bac49a0b 100644
--- a/src/lib_base.c
+++ b/src/lib_base.c
@@ -3,7 +3,7 @@
3** Copyright (C) 2005-2011 Mike Pall. See Copyright Notice in luajit.h 3** Copyright (C) 2005-2011 Mike Pall. See Copyright Notice in luajit.h
4** 4**
5** Major portions taken verbatim or adapted from the Lua interpreter. 5** Major portions taken verbatim or adapted from the Lua interpreter.
6** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h 6** Copyright (C) 1994-2011 Lua.org, PUC-Rio. See Copyright Notice in lua.h
7*/ 7*/
8 8
9#include <stdio.h> 9#include <stdio.h>
@@ -522,9 +522,15 @@ LJLIB_CF(coroutine_status)
522 522
523LJLIB_CF(coroutine_running) 523LJLIB_CF(coroutine_running)
524{ 524{
525#ifdef LUAJIT_ENABLE_LUA52COMPAT
526 int ismain = lua_pushthread(L);
527 setboolV(L->top++, ismain);
528 return 2;
529#else
525 if (lua_pushthread(L)) 530 if (lua_pushthread(L))
526 setnilV(L->top++); 531 setnilV(L->top++);
527 return 1; 532 return 1;
533#endif
528} 534}
529 535
530LJLIB_CF(coroutine_create) 536LJLIB_CF(coroutine_create)