mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Fix lua_yield() from C hook.
Reported by Jason Carr.
This commit is contained in:
parent
cc44642cf8
commit
dd5032ed84
@ -1210,11 +1210,12 @@ LUA_API int lua_yield(lua_State *L, int nresults)
|
|||||||
setcont(top, lj_cont_hook);
|
setcont(top, lj_cont_hook);
|
||||||
if (LJ_FR2) top++;
|
if (LJ_FR2) top++;
|
||||||
setframe_pc(top, cframe_pc(cf)-1);
|
setframe_pc(top, cframe_pc(cf)-1);
|
||||||
if (LJ_FR2) top++;
|
top++;
|
||||||
setframe_gc(top, obj2gco(L), LJ_TTHREAD);
|
setframe_gc(top, obj2gco(L), LJ_TTHREAD);
|
||||||
|
if (LJ_FR2) top++;
|
||||||
setframe_ftsz(top, ((char *)(top+1)-(char *)L->base)+FRAME_CONT);
|
setframe_ftsz(top, ((char *)(top+1)-(char *)L->base)+FRAME_CONT);
|
||||||
L->top = L->base = top+1;
|
L->top = L->base = top+1;
|
||||||
#if LJ_TARGET_X64
|
#if ((defined(__GNUC__) || defined(__clang__)) && (LJ_TARGET_X64 || defined(LUAJIT_UNWIND_EXTERNAL)) && !LJ_NO_UNWIND) || LJ_TARGET_WINDOWS
|
||||||
lj_err_throw(L, LUA_YIELD);
|
lj_err_throw(L, LUA_YIELD);
|
||||||
#else
|
#else
|
||||||
L->cframe = NULL;
|
L->cframe = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user