aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lcorolib.js4
-rw-r--r--src/lvm.js1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/lcorolib.js b/src/lcorolib.js
index b595d4d..32532a6 100644
--- a/src/lcorolib.js
+++ b/src/lcorolib.js
@@ -32,7 +32,7 @@ const auxresume = function(L, co, narg) {
lapi.lua_xmove(L, co, narg);
let status = ldo.lua_resume(co, L, narg);
if (status === TS.LUA_OK || status === TS.LUA_YIELD) {
- let nres = lapi.lua_gettop(L);
+ let nres = lapi.lua_gettop(co);
if (!lapi.lua_checkstack(L, nres + 1)) {
lapi.lua_pop(co, nres); /* remove results anyway */
lapi.lua_pushliteral(L, "too many results to resume");
@@ -123,7 +123,7 @@ const luaB_costatus = function(L) {
};
const luaB_yieldable = function(L) {
- lapi.lua_pushboolean(L, lapi.lua_isyieldable(L));
+ lapi.lua_pushboolean(L, ldo.lua_isyieldable(L));
return 1;
};
diff --git a/src/lvm.js b/src/lvm.js
index 15a11e4..5615acd 100644
--- a/src/lvm.js
+++ b/src/lvm.js
@@ -521,6 +521,7 @@ const luaV_execute = function(L) {
for (let aux = 0; nfuncOff + aux < lim; aux++)
L.stack[ofuncOff + aux] = L.stack[nfuncOff + aux];
oci.func = nci.func;
+ oci.funcOff = nci.funcOff;
oci.u.l.base = ofuncOff + (nci.u.l.base - nfuncOff);
L.top = ofuncOff + (L.top - nfuncOff);
oci.top = L.top;