summaryrefslogtreecommitdiff
path: root/vm1
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2023-08-25 11:21:49 +0200
committerMarc Vertes <mvertes@free.fr>2023-08-25 11:21:49 +0200
commita3ab9ef5be74cb54a87674aa48abb0c46f9c58f6 (patch)
tree570f7a776ca02d3da467d7afc84232397ba91d17 /vm1
parent706ca65800dfab293a0210b56602e1e9f8076fcc (diff)
chore: appease lint and vet
Diffstat (limited to 'vm1')
-rw-r--r--vm1/vm.go1
-rw-r--r--vm1/vm_test.go8
2 files changed, 6 insertions, 3 deletions
diff --git a/vm1/vm.go b/vm1/vm.go
index 0e9c7f7..f7113f2 100644
--- a/vm1/vm.go
+++ b/vm1/vm.go
@@ -153,7 +153,6 @@ func (m *Machine) Run() (err error) {
}
ip++
}
- return
}
func (m *Machine) PushCode(code [][]int64) (p int) {
diff --git a/vm1/vm_test.go b/vm1/vm_test.go
index cea4f29..257ac44 100644
--- a/vm1/vm_test.go
+++ b/vm1/vm_test.go
@@ -14,7 +14,9 @@ func TestVM(t *testing.T) {
m.Push(v)
}
m.PushCode(test.code)
- m.Run()
+ if err := m.Run(); err != nil {
+ t.Errorf("run error: %v", err)
+ }
t.Log(m.mem)
r := fmt.Sprintf("%v", m.mem[test.start:test.end])
if r != test.mem {
@@ -34,7 +36,9 @@ func BenchmarkVM(b *testing.B) {
m.PushCode(test.code)
b.StartTimer()
- m.Run()
+ if err := m.Run(); err != nil {
+ b.Errorf("run error: %v", err)
+ }
}
})
}