# HG changeset patch # User Matthew Wild # Date 1274617703 -3600 # Node ID 6cc1b0a8dd97aea0e6dc6da21d5c4654e510f9fa # Parent 035aacc192d8995737f43b2bba8956c7d534349b Instantiate a new LValue in OP_LOADK, otherwise "constants" aren't so constant... diff -r 035aacc192d8 -r 6cc1b0a8dd97 lvm.js --- 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", {});