aboutsummaryrefslogtreecommitdiffstats
path: root/sysparser
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-09-19 19:34:18 +0200
committerGitHub <noreply@github.com>2016-09-19 19:34:18 +0200
commit0c97d70213a4fbc6d8d57626c18b603f2a281047 (patch)
treeb06169dbe00277fa6c5438e993090db543d72c4d /sysparser
parentfebb6155f3997790ed163d6cf4b7122211d39eb3 (diff)
parent48818aa114afca38b61787e215bbec44f8421a9a (diff)
Merge pull request #76 from xairy/various_fixes
Various fixes
Diffstat (limited to 'sysparser')
-rw-r--r--sysparser/lexer.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/sysparser/lexer.go b/sysparser/lexer.go
index 26a21e57a..21c7b77ef 100644
--- a/sysparser/lexer.go
+++ b/sysparser/lexer.go
@@ -86,6 +86,9 @@ func Parse(in io.Reader) *Description {
}
}
}
+ if str.IsUnion && len(str.Flds) <= 1 {
+ failf("union %v has only %v fields, need at least 2", str.Name, len(str.Flds))
+ }
structs[str.Name] = *str
str = nil
} else {