aboutsummaryrefslogtreecommitdiffstats
path: root/prog/generation.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2021-10-01 14:43:02 +0000
committerAleksandr Nogikh <wp32pw@gmail.com>2021-10-01 17:45:20 +0200
commitdb0f57870523a9bff1629dad1a340ba8aac79d82 (patch)
tree33b82e919cef96856bf952c78c76190885877fdd /prog/generation.go
parentcc80db955d0551c2456692da6176530dd27e08ed (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/generation.go')
-rw-r--r--prog/generation.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/prog/generation.go b/prog/generation.go
index 037801b75..09240e858 100644
--- a/prog/generation.go
+++ b/prog/generation.go
@@ -27,7 +27,7 @@ func (target *Target) Generate(rs rand.Source, ncalls int, ct *ChoiceTable) *Pro
// The resources in the last call will be replaced with the default values,
// which is exactly what we want.
for len(p.Calls) > ncalls {
- p.removeCall(ncalls - 1)
+ p.RemoveCall(ncalls - 1)
}
p.sanitizeFix()
p.debugValidate()