aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-10-29 10:23:38 +0200
committerDmitry Vyukov <dvyukov@google.com>2016-11-11 14:29:05 -0800
commitc35c72f06c58f0b40980b0410c8a0fd513c3a892 (patch)
tree00c3968d47a8c58ed488f9613372cfb834ec42ab
parentd3a93e8370682fa5231bc94faf11ed3681b2ac99 (diff)
sysparser: check for reserved parent fields
-rw-r--r--sysparser/lexer.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/sysparser/lexer.go b/sysparser/lexer.go
index 06210a584..18143c901 100644
--- a/sysparser/lexer.go
+++ b/sysparser/lexer.go
@@ -93,6 +93,9 @@ func Parse(in io.Reader) *Description {
}
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)
}