diff options
| author | Florent Revest <revest@chromium.org> | 2024-11-28 01:49:47 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-12-09 18:35:48 +0000 |
| commit | 07e46fbc2bd7ff8782c975596672e4e3d3891865 (patch) | |
| tree | e5b5faf3f3225f930127716f3242b31b667dd36d /pkg/compiler/check.go | |
| parent | 9ac0fdc66500475f1914254ef369b32d51adbff9 (diff) | |
pkg/compiler: handle string syscall attributes
Diffstat (limited to 'pkg/compiler/check.go')
| -rw-r--r-- | pkg/compiler/check.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/compiler/check.go b/pkg/compiler/check.go index d693fa790..92e3e5e03 100644 --- a/pkg/compiler/check.go +++ b/pkg/compiler/check.go @@ -209,7 +209,7 @@ func (comp *compiler) checkStructFields(n *ast.Struct, typ, name string) { prevFieldHadIf := false for fieldIdx, f := range n.Fields { if n.IsUnion { - _, exprs := comp.parseAttrs(unionFieldAttrs, f, f.Attrs) + _, exprs, _ := comp.parseAttrs(unionFieldAttrs, f, f.Attrs) if fieldIdx > 0 && fieldIdx+1 < len(n.Fields) && prevFieldHadIf && exprs[attrIf] == nil { comp.error(f.Pos, "either no fields have conditions or all except the last") @@ -220,7 +220,7 @@ func (comp *compiler) checkStructFields(n *ast.Struct, typ, name string) { } continue } - attrs, _ := comp.parseAttrs(structFieldAttrs, f, f.Attrs) + attrs, _, _ := comp.parseAttrs(structFieldAttrs, f, f.Attrs) dirCount := attrs[attrIn] + attrs[attrOut] + attrs[attrInOut] if dirCount != 0 { hasDirections = true @@ -1458,7 +1458,7 @@ func (comp *compiler) checkVarlen(n *ast.Struct) { } } for i, f := range n.Fields { - _, exprs := comp.parseAttrs(structOrUnionFieldAttrs(n), f, f.Attrs) + _, exprs, _ := comp.parseAttrs(structOrUnionFieldAttrs(n), f, f.Attrs) if !n.IsUnion && i == len(n.Fields)-1 { break } |
