internal static void setList(Instruction i, ref LuaVM vm) { var abc = i.ABC(); var a = abc.Item1 + 1; var b = abc.Item2; var c = abc.Item3; if (c > 0) { c = c - 1; } else { c = new Instruction(vm.Fetch()).Ax(); } var bIsZero = b == 0; if (bIsZero) { b = (int)vm.ToInteger(-1) - a - 1; vm.Pop(1); } vm.CheckStack(1); var idx = (long)(c * LFIELDS_PER_FLUSH); for (var j = 1; j <= b; j++) { idx++; vm.PushValue(a + j); vm.SetI(a, idx); } if (bIsZero) { for (var j = vm.RegisterCount() + 1; j <= vm.GetTop(); j++) { idx++; vm.PushValue(j); vm.SetI(a, idx); } // clear stack vm.SetTop(vm.RegisterCount()); } }