summaryrefslogtreecommitdiff
path: root/vm/vm.go
diff options
context:
space:
mode:
Diffstat (limited to 'vm/vm.go')
-rw-r--r--vm/vm.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/vm/vm.go b/vm/vm.go
index 0aedaef..6c9f3e1 100644
--- a/vm/vm.go
+++ b/vm/vm.go
@@ -5,7 +5,8 @@ import (
"fmt" // for tracing only
"log" // for tracing only
"reflect" // for optional CallX only
- "unsafe" // to allow setting unexported struct fields
+ "strings"
+ "unsafe" // to allow setting unexported struct fields
)
const debug = true
@@ -65,9 +66,11 @@ type Instruction struct {
func (i Instruction) String() (s string) {
s = i.Op.String()
+ var sb strings.Builder
for _, a := range i.Arg {
- s += fmt.Sprintf(" %v", a)
+ sb.WriteString(fmt.Sprintf(" %v", a))
}
+ s += sb.String()
return s
}