aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ldo.c13
-rw-r--r--lvm.c5
-rw-r--r--lvm.h4
3 files changed, 11 insertions, 11 deletions
diff --git a/ldo.c b/ldo.c
index 37688a87..628aef12 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 2.174 2017/11/23 16:35:54 roberto Exp roberto $ 2** $Id: ldo.c,v 2.175 2017/11/23 18:29:41 roberto Exp roberto $
3** Stack and Call structure of Lua 3** Stack and Call structure of Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -468,7 +468,7 @@ void luaD_call (lua_State *L, StkId func, int nresults) {
468 ci->callstatus = CIST_LUA; 468 ci->callstatus = CIST_LUA;
469 if (L->hookmask) 469 if (L->hookmask)
470 callhook(L, ci, 0); 470 callhook(L, ci, 0);
471 luaV_execute(L); /* run the function */ 471 luaV_execute(L, ci); /* run the function */
472 break; 472 break;
473 } 473 }
474 default: { /* not a function */ 474 default: { /* not a function */
@@ -525,14 +525,15 @@ static void finishCcall (lua_State *L, int status) {
525** status is LUA_YIELD). 525** status is LUA_YIELD).
526*/ 526*/
527static void unroll (lua_State *L, void *ud) { 527static void unroll (lua_State *L, void *ud) {
528 CallInfo *ci;
528 if (ud != NULL) /* error status? */ 529 if (ud != NULL) /* error status? */
529 finishCcall(L, *(int *)ud); /* finish 'lua_pcallk' callee */ 530 finishCcall(L, *(int *)ud); /* finish 'lua_pcallk' callee */
530 while (L->ci != &L->base_ci) { /* something in the stack */ 531 while ((ci = L->ci) != &L->base_ci) { /* something in the stack */
531 if (!isLua(L->ci)) /* C function? */ 532 if (!isLua(ci)) /* C function? */
532 finishCcall(L, LUA_YIELD); /* complete its execution */ 533 finishCcall(L, LUA_YIELD); /* complete its execution */
533 else { /* Lua function */ 534 else { /* Lua function */
534 luaV_finishOp(L); /* finish interrupted instruction */ 535 luaV_finishOp(L); /* finish interrupted instruction */
535 luaV_execute(L); /* execute down to higher C 'boundary' */ 536 luaV_execute(L, ci); /* execute down to higher C 'boundary' */
536 } 537 }
537 } 538 }
538} 539}
@@ -606,7 +607,7 @@ static void resume (lua_State *L, void *ud) {
606 lua_assert(L->status == LUA_YIELD); 607 lua_assert(L->status == LUA_YIELD);
607 L->status = LUA_OK; /* mark that it is running (again) */ 608 L->status = LUA_OK; /* mark that it is running (again) */
608 if (isLua(ci)) /* yielded inside a hook? */ 609 if (isLua(ci)) /* yielded inside a hook? */
609 luaV_execute(L); /* just continue running Lua code */ 610 luaV_execute(L, ci); /* just continue running Lua code */
610 else { /* 'common' yield */ 611 else { /* 'common' yield */
611 if (ci->u.c.k != NULL) { /* does it have a continuation function? */ 612 if (ci->u.c.k != NULL) { /* does it have a continuation function? */
612 lua_unlock(L); 613 lua_unlock(L);
diff --git a/lvm.c b/lvm.c
index 63e65675..05a4646e 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 2.319 2017/11/28 12:58:18 roberto Exp roberto $ 2** $Id: lvm.c,v 2.320 2017/11/28 14:51:00 roberto Exp roberto $
3** Lua virtual machine 3** Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -823,8 +823,7 @@ void luaV_finishOp (lua_State *L) {
823#define vmbreak break 823#define vmbreak break
824 824
825 825
826void luaV_execute (lua_State *L) { 826void luaV_execute (lua_State *L, CallInfo *ci) {
827 CallInfo *ci = L->ci;
828 LClosure *cl = clLvalue(s2v(ci->func)); 827 LClosure *cl = clLvalue(s2v(ci->func));
829 TValue *k = cl->p->k; 828 TValue *k = cl->p->k;
830 StkId base = ci->func + 1; 829 StkId base = ci->func + 1;
diff --git a/lvm.h b/lvm.h
index c2e25574..0d2eed14 100644
--- a/lvm.h
+++ b/lvm.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.h,v 2.46 2017/07/07 16:34:32 roberto Exp roberto $ 2** $Id: lvm.h,v 2.47 2017/11/08 14:50:23 roberto Exp roberto $
3** Lua virtual machine 3** Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -112,7 +112,7 @@ LUAI_FUNC void luaV_finishget (lua_State *L, const TValue *t, TValue *key,
112LUAI_FUNC void luaV_finishset (lua_State *L, const TValue *t, TValue *key, 112LUAI_FUNC void luaV_finishset (lua_State *L, const TValue *t, TValue *key,
113 TValue *val, const TValue *slot); 113 TValue *val, const TValue *slot);
114LUAI_FUNC void luaV_finishOp (lua_State *L); 114LUAI_FUNC void luaV_finishOp (lua_State *L);
115LUAI_FUNC void luaV_execute (lua_State *L); 115LUAI_FUNC void luaV_execute (lua_State *L, CallInfo *ci);
116LUAI_FUNC void luaV_concat (lua_State *L, int total); 116LUAI_FUNC void luaV_concat (lua_State *L, int total);
117LUAI_FUNC lua_Integer luaV_div (lua_State *L, lua_Integer x, lua_Integer y); 117LUAI_FUNC lua_Integer luaV_div (lua_State *L, lua_Integer x, lua_Integer y);
118LUAI_FUNC lua_Integer luaV_mod (lua_State *L, lua_Integer x, lua_Integer y); 118LUAI_FUNC lua_Integer luaV_mod (lua_State *L, lua_Integer x, lua_Integer y);