diff options
Diffstat (limited to 'interp/interpreter.go')
| -rw-r--r-- | interp/interpreter.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/interp/interpreter.go b/interp/interpreter.go index 8d372c3..4faba28 100644 --- a/interp/interpreter.go +++ b/interp/interpreter.go @@ -42,7 +42,8 @@ func (i *Interp) Eval(src string) (res reflect.Value, err error) { i.Push(i.Data[dataOffset:]...) i.PushCode(i.Code[codeOffset:]...) if s, ok := i.Symbols["main"]; ok { - i.PushCode(vm.Instruction{Op: vm.Calli, Arg: []int{int(i.Data[s.Index].Int())}}) + i.PushCode(vm.Instruction{Op: vm.Push, Arg: []int{int(i.Data[s.Index].Int())}}) + i.PushCode(vm.Instruction{Op: vm.Call, Arg: []int{0}}) } i.PushCode(vm.Instruction{Op: vm.Exit}) i.SetIP(max(codeOffset, i.Entry)) |
