From be17c9cc24473b811d7b23ba61b6304aa4558fd6 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Wed, 14 Jan 2026 13:18:19 +0100 Subject: pkg/manager: match full function names in focus areas When configuring focus areas before directed fuzzing, construct regular expressions that match the exact function names. Otherwise, we end up adding more functions than intended. --- pkg/manager/diff.go | 7 ++++++- pkg/manager/diff_test.go | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/manager/diff.go b/pkg/manager/diff.go index 88710a59b..f972748d3 100644 --- a/pkg/manager/diff.go +++ b/pkg/manager/diff.go @@ -10,6 +10,7 @@ import ( "fmt" "math/rand" "net" + "regexp" "sort" "strings" "sync" @@ -817,11 +818,15 @@ func PatchFocusAreas(cfg *mgrconfig.Config, gitPatches [][]byte, baseHashes, pat funcs := modifiedSymbols(baseHashes, patchedHashes) if len(funcs) > 0 { log.Logf(0, "adding modified_functions to focus areas: %q", funcs) + var regexps []string + for _, name := range funcs { + regexps = append(regexps, fmt.Sprintf("^%s$", regexp.QuoteMeta(name))) + } cfg.Experimental.FocusAreas = append(cfg.Experimental.FocusAreas, mgrconfig.FocusArea{ Name: symbolsArea, Filter: mgrconfig.CovFilterCfg{ - Functions: funcs, + Functions: regexps, }, Weight: 6.0, }) diff --git a/pkg/manager/diff_test.go b/pkg/manager/diff_test.go index 9c17361d5..a73c31ffb 100644 --- a/pkg/manager/diff_test.go +++ b/pkg/manager/diff_test.go @@ -55,7 +55,7 @@ index 103167d..fbf7a68 100644 { Name: symbolsArea, Filter: mgrconfig.CovFilterCfg{ - Functions: []string{"function"}, + Functions: []string{"^function$"}, }, Weight: 6.0, }, -- cgit mrf-deployment