aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/declextract/serialization.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-12-13 15:15:49 +0100
committerDmitry Vyukov <dvyukov@google.com>2024-12-17 13:44:24 +0000
commitc8c15bb214509bafc8fe1a1e3abb8ccf90b3306e (patch)
treeca722a71aff5a1566389f178d9c95d7d7e8caeed /pkg/declextract/serialization.go
parentbc1a1b50f942408a9139887b914f745d9fa02adc (diff)
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.
Diffstat (limited to 'pkg/declextract/serialization.go')
-rw-r--r--pkg/declextract/serialization.go7
1 files changed, 6 insertions, 1 deletions
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")
}