From 076dbcb04d07743faf5fe058f73af1678d8868c9 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 26 May 2021 13:38:38 +0200 Subject: all: minor glob fixes --- prog/target.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'prog/target.go') diff --git a/prog/target.go b/prog/target.go index 974880c22..2cfb25108 100644 --- a/prog/target.go +++ b/prog/target.go @@ -227,25 +227,24 @@ func (target *Target) DefaultChoiceTable() *ChoiceTable { return target.defaultChoiceTable } -func (target *Target) GetGlobs() []string { - var globs []string +func (target *Target) GetGlobs() map[string]bool { + globs := make(map[string]bool) ForeachType(target.Syscalls, func(typ Type, ctx TypeCtx) { switch a := typ.(type) { case *BufferType: - if a.Kind == BufferGlob && a.SubKind != "" { - globs = append(globs, a.SubKind) + if a.Kind == BufferGlob { + globs[a.SubKind] = true } } }) - return globs } -func (target *Target) UpdateGlobFilesForType(globFiles map[string][]string) { +func (target *Target) UpdateGlobs(globFiles map[string][]string) { ForeachType(target.Syscalls, func(typ Type, ctx TypeCtx) { switch a := typ.(type) { case *BufferType: - if a.Kind == BufferGlob && a.SubKind != "" { + if a.Kind == BufferGlob { a.Values = globFiles[a.SubKind] } } -- cgit mrf-deployment