diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2024-01-10 14:28:27 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-01-11 14:13:27 +0000 |
| commit | dda5a9889e432dc7e9efe71a39292073fa6f6c00 (patch) | |
| tree | aff1da5e8b86de5f14c9482f7c983ec34b2060f4 /prog/target.go | |
| parent | 00f3cc59cbd59389deb590c4a852ea30d8c93499 (diff) | |
prog: prefer precise constructors
During resource argument generation, we used to randomly select one of
the matching resources. With so many descendants of fd, this becomes
quite inefficient and most of the time syzkaller fails to build correct
programs.
Give precise resource contructions priority. Experiment with other
resource types only in 1/3 of cases.
Diffstat (limited to 'prog/target.go')
| -rw-r--r-- | prog/target.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/prog/target.go b/prog/target.go index 36fde13de..761dce34a 100644 --- a/prog/target.go +++ b/prog/target.go @@ -69,7 +69,7 @@ type Target struct { types []Type resourceMap map[string]*ResourceDesc // Maps resource name to a list of calls that can create the resource. - resourceCtors map[string][]*Syscall + resourceCtors map[string][]ResourceCtor any anyTypes // The default ChoiceTable is used only by tests and utilities, so we initialize it lazily. @@ -169,7 +169,7 @@ func (target *Target) initTarget() { } target.populateResourceCtors() - target.resourceCtors = make(map[string][]*Syscall) + target.resourceCtors = make(map[string][]ResourceCtor) for _, res := range target.Resources { target.resourceCtors[res.Name] = target.calcResourceCtors(res, false) } |
