aboutsummaryrefslogtreecommitdiffstats
path: root/sys/syz-sysgen
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-03-15 21:16:13 +0100
committerDmitry Vyukov <dvyukov@google.com>2020-03-17 21:19:13 +0100
commit924f7606047a430a9b313c135b782e1e8f852bec (patch)
tree649fbf186af5268815f16884875f92d948ad57b0 /sys/syz-sysgen
parent5de34a784c610ab08888c185dd0c09f542d62d4f (diff)
pkg/compiler: ensure consistency of syscall argument types
Ensure that we don't have conflicting sizes for the same argument of the same syscall, e.g.: foo$1(a int16) foo$2(a int32) This is useful for several reasons: - we will be able avoid morphing syscalls into other syscalls - we will be able to figure out more precise sizes for args (lots of them are implicitly intptr, which is the largest type on most important arches) - found few bugs in linux descriptions Update #477 Update #502
Diffstat (limited to 'sys/syz-sysgen')
-rw-r--r--sys/syz-sysgen/sysgen.go18
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/syz-sysgen/sysgen.go b/sys/syz-sysgen/sysgen.go
index 1737e4544..6a89a1428 100644
--- a/sys/syz-sysgen/sysgen.go
+++ b/sys/syz-sysgen/sysgen.go
@@ -58,14 +58,26 @@ type OSData struct {
func main() {
flag.Parse()
+ var OSList []string
+ for OS := range targets.List {
+ OSList = append(OSList, OS)
+ }
+ sort.Strings(OSList)
+
var oses []OSData
- for OS, archs := range targets.List {
+ for _, OS := range OSList {
top := ast.ParseGlob(filepath.Join("sys", OS, "*.txt"), nil)
if top == nil {
os.Exit(1)
}
osutil.MkdirAll(filepath.Join("sys", OS, "gen"))
+ var archs []string
+ for arch := range targets.List[OS] {
+ archs = append(archs, arch)
+ }
+ sort.Strings(archs)
+
type Job struct {
Target *targets.Target
OK bool
@@ -74,9 +86,9 @@ func main() {
ArchData ArchData
}
var jobs []*Job
- for _, target := range archs {
+ for _, arch := range archs {
jobs = append(jobs, &Job{
- Target: target,
+ Target: targets.List[OS][arch],
})
}
sort.Slice(jobs, func(i, j int) bool {