summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-06-03 14:12:18 +1000
committerdaurnimator <quae@daurnimator.com>2017-06-03 14:12:18 +1000
commit95c45661d7ba298fad34cb348c454ac1ee5f4f56 (patch)
tree50e52e87c66e9e51a976633b43c02ac4e60f3f42
parent78660b46d9c7a7e4f9530d8db6a334d5a328c5f1 (diff)
downloadfengari-95c45661d7ba298fad34cb348c454ac1ee5f4f56.tar.gz
fengari-95c45661d7ba298fad34cb348c454ac1ee5f4f56.tar.bz2
fengari-95c45661d7ba298fad34cb348c454ac1ee5f4f56.zip
src/ldo.js: Fix calling wrong stack index for atnativeerror
-rw-r--r--src/ldo.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ldo.js b/src/ldo.js
index 5e3e30a..ed1213e 100644
--- a/src/ldo.js
+++ b/src/ldo.js
@@ -380,7 +380,7 @@ const luaD_rawrunprotected = function(L, f, ud) {
if (L.errfunc !== 0) { /* is there an error handling function? */
let errfunc = L.errfunc;
lobject.pushobj2s(L, L.stack[L.top - 1]); /* move argument */
- lobject.setobjs2s(L, L.top - 1, errfunc); /* push function */
+ lobject.setobjs2s(L, L.top - 2, errfunc); /* push function */
luaD_callnoyield(L, L.top - 2, 1);
}