about summary refs log tree commit diff
path: root/pkg/lang/vm/exec.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/lang/vm/exec.go')
-rw-r--r--pkg/lang/vm/exec.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/pkg/lang/vm/exec.go b/pkg/lang/vm/exec.go
index ade6cc0..34cf444 100644
--- a/pkg/lang/vm/exec.go
+++ b/pkg/lang/vm/exec.go
@@ -836,9 +836,8 @@ func (vm *VM) execCall(argCount uint) error {
 	var err error
 
 	args := make([]value.Value, argCount)
-	for i := 0; i < int(argCount); i++ {
-		args[i], err = vm.stack.Pop()
-		if err != nil {
+	for i := int(argCount - 1); i >= 0; i-- {
+		if args[i], err = vm.stack.Pop(); err != nil {
 			return err
 		}
 	}