aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorAndrey Konovalov <andreyknvl@google.com>2016-12-20 18:12:07 +0100
committerAndrey Konovalov <andreyknvl@google.com>2016-12-20 18:12:07 +0100
commitdf98b6bde521211c8f1246157e5e6a4a40e710f4 (patch)
tree648a0abb9db00f2364c028154807666ec2b51d6b /sys
parent80b6c954f8daa8d9910698be9eca6d97284a75a0 (diff)
prog: add bytesizeN types
Diffstat (limited to 'sys')
-rw-r--r--sys/decl.go2
-rw-r--r--sys/test.txt11
2 files changed, 12 insertions, 1 deletions
diff --git a/sys/decl.go b/sys/decl.go
index bb82cfa18..63fca61b7 100644
--- a/sys/decl.go
+++ b/sys/decl.go
@@ -157,7 +157,7 @@ type LenType struct {
TypeCommon
TypeSize uintptr
BigEndian bool
- ByteSize bool // want size in bytes instead of array size
+ ByteSize uintptr // want size in multiple of bytes instead of array size
Buf string
}
diff --git a/sys/test.txt b/sys/test.txt
index e6865b467..2c0c489a1 100644
--- a/sys/test.txt
+++ b/sys/test.txt
@@ -97,6 +97,8 @@ syz_test$length13(a0 ptr[inout, syz_length_large_struct], a1 ptr[inout, len[a0,
syz_test$length14(a0 ptr[inout, syz_length_large_struct], a1 ptr[inout, len[a0, int64], opt])
syz_test$length15(a0 int16, a1 len[a0])
+syz_test$length16(a0 ptr[in, syz_length_bytesize_struct])
+
syz_length_flags = 0, 1
syz_length_int_struct {
@@ -167,6 +169,15 @@ syz_length_large_struct {
f2 array[int32, 8]
}
+syz_length_bytesize_struct {
+ f0 array[int64, 2]
+ f1 len[f0, int8]
+ f2 bytesize[f0, int8]
+ f3 bytesize2[f0, int8]
+ f4 bytesize4[f0, int8]
+ f5 bytesize8[f0, int8]
+}
+
# Big endian.
syz_test$end0(a0 ptr[in, syz_end_int_struct])