aboutsummaryrefslogtreecommitdiffstats
path: root/prog
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-04-12 12:16:44 +0200
committerAleksandr Nogikh <nogikh@google.com>2024-04-12 10:28:42 +0000
commitc8349e48534ea6d8f01515335d95de8ebf5da8df (patch)
treebf1aecfeab11214c72f308f545aec171ef6fd25e /prog
parenta154e0561c08f453f15d76846b8805771ab02032 (diff)
prog: cleanup ChoiceTable
We don't use Enabled() anywhere.
Diffstat (limited to 'prog')
-rw-r--r--prog/prio.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/prog/prio.go b/prog/prio.go
index 78e5a1758..ca4e11de4 100644
--- a/prog/prio.go
+++ b/prog/prio.go
@@ -199,10 +199,9 @@ func normalizePrios(prios [][]int32) {
// ChooseTable allows to do a weighted choice of a syscall for a given syscall
// based on call-to-call priorities and a set of enabled and generatable syscalls.
type ChoiceTable struct {
- target *Target
- runs [][]int32
- calls []*Syscall
- noGenerateCalls map[int]bool
+ target *Target
+ runs [][]int32
+ calls []*Syscall
}
func (target *Target) BuildChoiceTable(corpus []*Prog, enabled map[*Syscall]bool) *ChoiceTable {
@@ -260,11 +259,7 @@ func (target *Target) BuildChoiceTable(corpus []*Prog, enabled map[*Syscall]bool
run[i][j] = sum
}
}
- return &ChoiceTable{target, run, generatableCalls, noGenerateCalls}
-}
-
-func (ct *ChoiceTable) Enabled(call int) bool {
- return ct.Generatable(call) || ct.noGenerateCalls[call]
+ return &ChoiceTable{target, run, generatableCalls}
}
func (ct *ChoiceTable) Generatable(call int) bool {