mirror of
https://github.com/reactos/syzkaller.git
synced 2024-11-23 11:29:46 +00:00
prog: sort enabled syscalls for determinism
Makes tests deterministic and syz-mutate with -seed flag. Pointed out by Jordan Frank (@jwf).
This commit is contained in:
parent
850c989d4f
commit
7fb694ef82
@ -221,6 +221,9 @@ func (target *Target) BuildChoiceTable(prios [][]float32, enabled map[*Syscall]b
|
||||
if len(enabledCalls) == 0 {
|
||||
panic(fmt.Sprintf("empty enabledCalls, len(target.Syscalls)=%v", len(target.Syscalls)))
|
||||
}
|
||||
sort.Slice(enabledCalls, func(i, j int) bool {
|
||||
return enabledCalls[i].ID < enabledCalls[j].ID
|
||||
})
|
||||
run := make([][]int, len(target.Syscalls))
|
||||
for i := range run {
|
||||
if !enabled[target.Syscalls[i]] {
|
||||
|
Loading…
Reference in New Issue
Block a user