Sun, 23 May 2010 13:28:23 +0100
Instantiate a new LValue in OP_LOADK, otherwise "constants" aren't so constant...
lvm.js | file | annotate | diff | comparison | revisions |
--- a/lvm.js Sun May 23 13:27:36 2010 +0100 +++ b/lvm.js Sun May 23 13:28:23 2010 +0100 @@ -313,8 +313,8 @@ this.frame.f.environment.setIndex(name, this.frame.reg[instruction[1]]); break; case OP_LOADK: - var value = this.frame.f.constants[INS_Bx(instruction)]; - this.frame.reg[INS_A(instruction)] = value; + var constant = this.frame.f.constants[INS_Bx(instruction)]; + this.frame.reg[INS_A(instruction)] = new LValue(constant.type, constant.value); break; case OP_NEWTABLE: this.frame.reg[INS_A(instruction)] = new LValue("table", {});