aboutsummaryrefslogtreecommitdiffstats
path: root/sys/freebsd
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-11-28 14:27:28 +0100
committerDmitry Vyukov <dvyukov@google.com>2017-11-28 14:55:21 +0100
commitac93d7e1d83ffac19983e9d754a47e7808f1230e (patch)
tree3fa594e98d47bd7e23d64594e196bc6c6a4bf408 /sys/freebsd
parentafba0b55e6d3692ac33c71553cb4cf61fc6a53e4 (diff)
pkg/compiler: add check that len does not refer to array with varlen elements
This [almost] always means a bug in descriptions. Fix all bugs identified by the check.
Diffstat (limited to 'sys/freebsd')
-rw-r--r--sys/freebsd/amd64.go6
-rw-r--r--sys/freebsd/socket.txt2
-rw-r--r--sys/freebsd/socket_unix.txt2
3 files changed, 5 insertions, 5 deletions
diff --git a/sys/freebsd/amd64.go b/sys/freebsd/amd64.go
index 14ec959e2..0182660b7 100644
--- a/sys/freebsd/amd64.go
+++ b/sys/freebsd/amd64.go
@@ -310,7 +310,7 @@ var structDescs_amd64 = []*KeyedStruct{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "vec", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array"}, Type: &StructType{Key: StructKey{Name: "iovec_in"}}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "vlen", TypeSize: 8}}, Buf: "vec"},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ctrl", TypeSize: 8, IsOptional: true}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array"}, Type: &UnionType{Key: StructKey{Name: "cmsghdr_un"}}}},
- &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "ctrllen", TypeSize: 8}}, Buf: "ctrl"},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "ctrllen", TypeSize: 8}}, ByteSize: 1, Buf: "ctrl"},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "send_flags", FldName: "f", TypeSize: 4}}, Vals: []uint64{2048, 4, 128, 8, 131072, 1}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true},
}}},
@@ -393,7 +393,7 @@ var structDescs_amd64 = []*KeyedStruct{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "msg_iov", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array"}, Type: &StructType{Key: StructKey{Name: "iovec_in"}}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "msg_iovlen", TypeSize: 8}}, Buf: "msg_iov"},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "msg_control", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array"}, Type: &StructType{Key: StructKey{Name: "cmsghdr"}}}},
- &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "msg_controllen", TypeSize: 8}}, Buf: "msg_control"},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "msg_controllen", TypeSize: 8}}, ByteSize: 1, Buf: "msg_control"},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "send_flags", FldName: "msg_flags", TypeSize: 4}}, Vals: []uint64{2048, 4, 128, 8, 131072, 1}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true},
}}},
@@ -2440,4 +2440,4 @@ var consts_amd64 = []ConstValue{
{Name: "WUNTRACED", Value: 2},
}
-const revision_amd64 = "3daf5c34426e30649a123866a30a5aad1ace2db2"
+const revision_amd64 = "c26bf7b88409b952bbd71df82a0fd04fba60a218"
diff --git a/sys/freebsd/socket.txt b/sys/freebsd/socket.txt
index 2c2d3600e..5874a9af9 100644
--- a/sys/freebsd/socket.txt
+++ b/sys/freebsd/socket.txt
@@ -72,7 +72,7 @@ send_msghdr {
msg_iov ptr[in, array[iovec_in]]
msg_iovlen len[msg_iov, intptr]
msg_control ptr[in, array[cmsghdr]]
- msg_controllen len[msg_control, intptr]
+ msg_controllen bytesize[msg_control, intptr]
msg_flags flags[send_flags, int32]
}
diff --git a/sys/freebsd/socket_unix.txt b/sys/freebsd/socket_unix.txt
index 6eebd627f..011d44521 100644
--- a/sys/freebsd/socket_unix.txt
+++ b/sys/freebsd/socket_unix.txt
@@ -54,7 +54,7 @@ msghdr_un {
vec ptr[in, array[iovec_in]]
vlen len[vec, intptr]
ctrl ptr[in, array[cmsghdr_un], opt]
- ctrllen len[ctrl, intptr]
+ ctrllen bytesize[ctrl, intptr]
f flags[send_flags, int32]
}