aboutsummaryrefslogtreecommitdiffstats
path: root/sysgen
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2017-01-18 13:03:48 +0100
committerAndrey Konovalov <andreyknvl@google.com>2017-01-18 19:16:07 +0100
commit109c58ef682799fc7e92d7a74a9c3073f1ccd0ec (patch)
tree0afab56194498858fe743589da1466956abbff0b /sysgen
parent11fa77cbbed73f018515d2ec5c6bff4123aa763a (diff)
prog: mutate sized strings with respect to size
Diffstat (limited to 'sysgen')
-rw-r--r--sysgen/sysgen.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysgen/sysgen.go b/sysgen/sysgen.go
index ecc237118..c71936c01 100644
--- a/sysgen/sysgen.go
+++ b/sysgen/sysgen.go
@@ -433,8 +433,8 @@ func generateArg(
for i, s := range vals {
vals[i] = s + "\x00"
}
+ var size uint64
if len(a) >= 2 {
- var size uint64
if v, ok := consts[a[1]]; ok {
size = v
} else {
@@ -454,7 +454,7 @@ func generateArg(
vals[i] = s
}
}
- fmt.Fprintf(out, "&BufferType{%v, Kind: BufferString, SubKind: %q, Values: %#v}", common(), subkind, vals)
+ fmt.Fprintf(out, "&BufferType{%v, Kind: BufferString, SubKind: %q, Values: %#v, Length: %v}", common(), subkind, vals, size)
case "salg_type":
if want := 0; len(a) != want {
failf("wrong number of arguments for %v arg %v, want %v, got %v", typ, name, want, len(a))