diff --git a/src/Vm/InstructionGenerator.cs b/src/Vm/InstructionGenerator.cs index e2d8fe8..11b88c1 100644 --- a/src/Vm/InstructionGenerator.cs +++ b/src/Vm/InstructionGenerator.cs @@ -991,7 +991,7 @@ private void EmitCall(CallExpr expr, bool isMaybeRoot = false, RuntimeFunction? : (byte)variadicStart, Closure = expr.IsReference ? closure - : null + : null, }; EmitBig(InstructionKind.Const, runtimeFunction); @@ -1360,7 +1360,7 @@ private void Visit(ClosureExpr expr, bool isMaybeRoot = false) page.AddLine(expr.StartPosition.Line); _currentPage = page; - foreach (var parameter in expr.Parameters) + foreach (var parameter in expr.Parameters.AsEnumerable().Reverse()) _locals.Push(new Variable(parameter, 0)); var previousBasePointer = _currentBasePointer;