From df98b6bde521211c8f1246157e5e6a4a40e710f4 Mon Sep 17 00:00:00 2001 From: Andrey Konovalov Date: Tue, 20 Dec 2016 18:12:07 +0100 Subject: prog: add bytesizeN types --- sys/decl.go | 2 +- sys/test.txt | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'sys') 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]) -- cgit mrf-deployment