From 162bd26be4e47d89f305435f7a1917b023138ed6 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 1 Apr 2019 12:46:10 +0200 Subject: pkg/compiler: make buffer alias to ptr[array[int8]] Ptr type has special handling of direction (pointers are always input). But buffer type missed this special case all the time. Make buffer less special by aliasing to the ptr[array[int8]] type. As the result buffer type can't have optional trailing "opt" attribute because we don't have such support for templates yet. Change such cases to use ptr type directly. Fixes #1097 --- sys/test/gen/64.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/test') diff --git a/sys/test/gen/64.go b/sys/test/gen/64.go index 17c535cda..3438bde60 100644 --- a/sys/test/gen/64.go +++ b/sys/test/gen/64.go @@ -493,7 +493,7 @@ var structDescs_64 = []*KeyedStruct{ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "a3", TypeSize: 8, IsOptional: true}, Type: &StructType{Key: StructKey{Name: "syz_recur_2_0"}}}, }}}, {Key: StructKey{Name: "syz_regression0_struct", Dir: 2}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_regression0_struct", TypeSize: 8, ArgDir: 2}, Fields: []Type{ - &PtrType{TypeCommon: TypeCommon{TypeName: "buffer", FldName: "f0", TypeSize: 8, ArgDir: 2}, Type: &BufferType{TypeCommon: TypeCommon{ArgDir: 1, IsVarlen: true}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "f0", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1, IsVarlen: true}}}, }}}, {Key: StructKey{Name: "syz_regression1_struct"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "syz_regression1_struct", TypeSize: 4}, Fields: []Type{ &BufferType{TypeCommon: TypeCommon{TypeName: "array", FldName: "f0", TypeSize: 4}, Kind: 1, RangeBegin: 4, RangeEnd: 4}, @@ -970,4 +970,4 @@ var consts_64 = []ConstValue{ {Name: "SYS_unsupported"}, } -const revision_64 = "f2ea17f08041673e28f3c64109373c828a27d585" +const revision_64 = "7b63ffeeaca40cb4b5b8e33cc6c9ead27f7e7741" -- cgit mrf-deployment