summaryrefslogtreecommitdiff
path: root/src/lcorolib.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-23 12:40:46 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-23 12:47:12 +0100
commit2ffe44e84bfb72f44e4a2a598591cf0ec1c1c704 (patch)
tree3ef6287240366503951d72cb79ee0717e7f740f7 /src/lcorolib.js
parent6d88293ea029a2372250297bd014b78d40507aa7 (diff)
downloadfengari-2ffe44e84bfb72f44e4a2a598591cf0ec1c1c704.tar.gz
fengari-2ffe44e84bfb72f44e4a2a598591cf0ec1c1c704.tar.bz2
fengari-2ffe44e84bfb72f44e4a2a598591cf0ec1c1c704.zip
Fixed bad lua_gettop
Diffstat (limited to 'src/lcorolib.js')
-rw-r--r--src/lcorolib.js4
1 files changed, 2 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;
};