mirror of
https://github.com/reactos/syzkaller.git
synced 2024-11-24 03:49:45 +00:00
pkg/compiler: prohibit len of other union options
This commit is contained in:
parent
7a7c747c6f
commit
5c1e020706
@ -256,8 +256,11 @@ func (comp *compiler) checkLenType(t *ast.Type, name string, fields []*ast.Field
|
||||
}
|
||||
checked[s.Name.Name] = true
|
||||
parents = append(parents, s)
|
||||
if !s.IsUnion {
|
||||
fields = s.Fields
|
||||
}
|
||||
for _, fld := range s.Fields {
|
||||
comp.checkLenType(fld.Type, fld.Name.Name, s.Fields, parents, checked, false)
|
||||
comp.checkLenType(fld.Type, fld.Name.Name, fields, parents, checked, false)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
6
pkg/compiler/testdata/errors2.txt
vendored
6
pkg/compiler/testdata/errors2.txt
vendored
@ -73,8 +73,14 @@ s2 {
|
||||
f1 s1
|
||||
}
|
||||
|
||||
u1 [
|
||||
f1 ptr[in, array[int8]]
|
||||
f2 len[f1, int32] ### len target f1 does not exist
|
||||
]
|
||||
|
||||
foo$200(a ptr[in, s2])
|
||||
foo$201(a ptr[in, s1])
|
||||
foo$202(a u1)
|
||||
|
||||
# Resource ctor tests.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user