# HG changeset patch # User Matthew Wild # Date 1270610123 -3600 # Node ID ae0b4ec242a33cbdf3932c180393e99ea9c86fc3 # Parent ac02246fc1d181fbe5dbc17144b764cf76eb43be Support for B==0 in OP_CALL (signifies params are to top of the stack) diff -r ac02246fc1d1 -r ae0b4ec242a3 lvm.js --- a/lvm.js Wed Apr 07 03:07:10 2010 +0100 +++ b/lvm.js Wed Apr 07 04:15:23 2010 +0100 @@ -284,7 +284,8 @@ break; case OP_CALL: var f = this.frame.reg[INS_A(instruction)].call(); // return JS or LValue - var args = this.frame.reg.slice(INS_A(instruction)+1, INS_A(instruction)+(INS_B(instruction))); + var A = INS_A(instruction), B = INS_B(instruction), undefined; + var args = this.frame.reg.slice(A+1, B==0?undefined:(A+B)); if(typeof(f) == "function") { // JS native function