From 576c26a1524fc962de6cae781bf9ea5aebeaf7a3 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 5 Jan 2022 13:47:09 +0100 Subject: prog: fix call selection in rotation logic We select calls from ctors[0] twice, but don't select calls from ctors[2] at all. The second use of ctots[0] is supposed to be ctors[2]. Also use 'true' for always true conditions (we check them earlier). --- prog/rotation.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prog/rotation.go b/prog/rotation.go index 544f22730..2eca62e55 100644 --- a/prog/rotation.go +++ b/prog/rotation.go @@ -174,11 +174,11 @@ func (rs *rotatorState) Select() map[*Syscall]bool { if nctors0 { continue } - rs.selectCalls(info.ctors[1], 2, !nctors0) + rs.selectCalls(info.ctors[1], 2, true) if nctors1 { continue } - rs.selectCalls(info.ctors[0], 2, !nctors1) + rs.selectCalls(info.ctors[2], 2, true) continue } if len(rs.topQueue) == 0 { @@ -212,7 +212,7 @@ func (rs *rotatorState) Select() map[*Syscall]bool { nctors1 := nctors0 || len(info.ctors[1]) != 0 rs.selectCalls(info.ctors[0], 5, true) rs.selectCalls(info.ctors[1], 3, !nctors0) - rs.selectCalls(info.ctors[0], 2, !nctors1) + rs.selectCalls(info.ctors[2], 2, !nctors1) rs.selectCalls(info.uses[0], 20, true) rs.selectCalls(info.uses[1], 2, len(info.uses[0]) == 0) } -- cgit mrf-deployment