From 364326b97450564d41d37cdc7b2c4fbb8049c62f Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Tue, 7 Feb 2017 21:55:34 +0100 Subject: First CallInfo expects LUA_MULTRET results --- src/lstate.js | 2 ++ src/lvm.js | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lstate.js b/src/lstate.js index ef84e07..b919f0e 100644 --- a/src/lstate.js +++ b/src/lstate.js @@ -1,6 +1,7 @@ /*jshint esversion: 6 */ "use strict"; +const LUA_MULTRET = require('./lua.js').LUA_MULTRET; class CallInfo { @@ -28,6 +29,7 @@ class lua_State { this.top = 1; this.ci = new CallInfo(0, cl, 1, 1, null, null); this.ci.u.l.savedpc = cl.p.code; + this.ci.nresults = LUA_MULTRET; this.ciOff = 0; this.stack = [ cl diff --git a/src/lvm.js b/src/lvm.js index cb2a795..d548e77 100644 --- a/src/lvm.js +++ b/src/lvm.js @@ -70,8 +70,6 @@ class LuaVM { let i = ci.u.l.savedpc[ci.pcOff++]; let ra = this.RA(base, i); - console.log(`Before ${OC.OpCodes[i.opcode]} L.top is ${L.top}`); - switch (OC.OpCodes[i.opcode]) { case "OP_MOVE": { L.stack[ra] = L.stack[this.RB(base, i)]; -- cgit v1.2.3-70-g09d2