From 55db79dace02d22a7e0a6462cbf0b2b52f411639 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Mon, 6 Feb 2017 08:55:53 +0100 Subject: postcall and precall In the tests, we just look at the last n elements of the stack to check our results. This is because the executed script itself doesn't expect any result, so we did not put results at L.top. --- src/lvm.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lvm.js') diff --git a/src/lvm.js b/src/lvm.js index 155e057..95382b3 100644 --- a/src/lvm.js +++ b/src/lvm.js @@ -450,7 +450,7 @@ class LuaVM { if (L.ci.next) { L.ci = L.ci.next; } else { - ci = new CallInfo(); + ci = new CallInfo(off); L.ci.next = ci; ci.previous = L.ci; ci.next = null; @@ -473,7 +473,7 @@ class LuaVM { postcall(ci, firstResult, nres) { let wanted = ci.nresults; - let res = ci.func; + let res = ci.funcOff; this.L.ci = ci.previous; this.L.ciOff--; return this.moveresults(firstResult, res, nres, wanted); -- cgit v1.2.3-54-g00ecf