From 95c45661d7ba298fad34cb348c454ac1ee5f4f56 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sat, 3 Jun 2017 14:12:18 +1000 Subject: src/ldo.js: Fix calling wrong stack index for atnativeerror --- src/ldo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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); } -- cgit v1.2.3-70-g09d2