summaryrefslogtreecommitdiff
path: root/vm1
diff options
context:
space:
mode:
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)
+ }
}
})
}