aboutsummaryrefslogtreecommitdiffstats
path: root/sys/syz-sysgen
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-08-27 19:55:14 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-08-27 20:19:41 +0200
commit4074aed7c0c28afc7d4a3522045196c3f39b5208 (patch)
tree8d2c2ce5f6767f8f4355e37e262f85223ee362e3 /sys/syz-sysgen
parent58579664687b203ff34fad8aa02bf470ef0bc981 (diff)
pkg/compiler: more static error checking
Update #217
Diffstat (limited to 'sys/syz-sysgen')
-rw-r--r--sys/syz-sysgen/sysgen.go17
1 files changed, 1 insertions, 16 deletions
diff --git a/sys/syz-sysgen/sysgen.go b/sys/syz-sysgen/sysgen.go
index 984a5b4e8..f53f247bc 100644
--- a/sys/syz-sysgen/sysgen.go
+++ b/sys/syz-sysgen/sysgen.go
@@ -132,8 +132,6 @@ func (a syscallArray) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func astToDesc(top *ast.Description) *Description {
// As a temporal measure we just convert the new representation to the old one.
- // TODO: check for duplicate defines, structs, resources.
- // TODO: check for duplicate syscall argument names.
desc := &Description{
Structs: make(map[string]*Struct),
Unnamed: make(map[string][]string),
@@ -155,7 +153,7 @@ func astToDesc(top *ast.Description) *Description {
}
desc.Resources[n.Name.Name] = Resource{
Name: n.Name.Name,
- Base: n.Base.Name,
+ Base: n.Base.Ident,
Values: vals,
}
case *ast.Call:
@@ -209,19 +207,6 @@ func astToDesc(top *ast.Description) *Description {
}
}
}
- if str.IsUnion && len(str.Flds) <= 1 {
- failf("union %v has only %v fields, need at least 2", str.Name, len(str.Flds))
- }
- fields := make(map[string]bool)
- for _, f := range str.Flds {
- if f[0] == "parent" {
- failf("struct/union %v contains reserved field 'parent'", str.Name)
- }
- if fields[f[0]] {
- failf("duplicate field %v in struct/union %v", f[0], str.Name)
- }
- fields[f[0]] = true
- }
desc.Structs[str.Name] = str
case *ast.IntFlags:
var vals []string