diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2021-10-01 14:43:02 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2021-10-01 17:45:20 +0200 |
| commit | db0f57870523a9bff1629dad1a340ba8aac79d82 (patch) | |
| tree | 33b82e919cef96856bf952c78c76190885877fdd /prog/rand.go | |
| parent | cc80db955d0551c2456692da6176530dd27e08ed (diff) | |
pkg/csource: remove calls instead of skipping them
Currently csource skips calls at the very last moment, which has an
unpleasant consequence - if we make choice of enabled defines depend on
the individual calls or call properties, we may end up with defined yet
unused functions.
The perfect solution would be to untie
syz_emit_ethernet/syz_extract_tcp_res and NetInjection, and also to
untie VhciInjection and syz_emit_vhci.
For the time being, move these checks to the very beginning of csource
processing, so that these calls could be removed before we construct our
defines.
Adjust pkg/csource/csource_test.go to better cover fault injection
generation problems.
Diffstat (limited to 'prog/rand.go')
| -rw-r--r-- | prog/rand.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/prog/rand.go b/prog/rand.go index f36cb0822..7a7de9b4a 100644 --- a/prog/rand.go +++ b/prog/rand.go @@ -881,7 +881,7 @@ func (r *randGen) resourceCentric(s *state, t *ResourceType, dir Dir) (arg Arg, } }) if !includeCall { - p.removeCall(idx) + p.RemoveCall(idx) } else { for _, res := range newResources { relatedRes[res] = true @@ -895,7 +895,7 @@ func (r *randGen) resourceCentric(s *state, t *ResourceType, dir Dir) (arg Arg, // Removes the references that are not used anymore. for i := biasedLen; i < len(calls); i++ { - p.removeCall(i) + p.RemoveCall(i) } return MakeResultArg(t, dir, resource, 0), p.Calls |
