From c8c15bb214509bafc8fe1a1e3abb8ccf90b3306e Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 13 Dec 2024 15:15:49 +0100 Subject: tools/syz-declextract: infer argument/field types Use data flow analysis to infer syscall argument, return value, and struct field types. See the comment in pkg/declextract/typing.go for more details. --- pkg/declextract/serialization.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pkg/declextract/serialization.go') diff --git a/pkg/declextract/serialization.go b/pkg/declextract/serialization.go index 6d27d2a13..d69358679 100644 --- a/pkg/declextract/serialization.go +++ b/pkg/declextract/serialization.go @@ -27,6 +27,11 @@ meta automatic type auto_todo int8 +type auto_union[INFERRED, RAW] [ + inferred INFERRED + raw RAW +] + ` func (ctx *context) fmt(msg string, args ...any) { @@ -53,7 +58,7 @@ func (ctx *context) serializeSyscalls() { for i, arg := range call.Args { ctx.fmt("%v%v %v", comma(i), arg.Name, arg.syzType) } - ctx.fmt(")\n") + ctx.fmt(") %v\n", call.returnType) } ctx.fmt("\n") } -- cgit mrf-deployment