From d412ea5e8e2e0b9aa2188b82d28243a63bbde0a8 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 18 Jan 2020 13:11:07 +0100 Subject: pkg/compiler: sort flags values Will simplify runtime analysis of flags. Also just no reason to make it more deterministic and avoid unnecessary diffs in future if values are reordered. --- pkg/compiler/types.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkg') diff --git a/pkg/compiler/types.go b/pkg/compiler/types.go index 8a488dca8..8b3b97101 100644 --- a/pkg/compiler/types.go +++ b/pkg/compiler/types.go @@ -5,6 +5,7 @@ package compiler import ( "fmt" + "sort" "strconv" "github.com/google/syzkaller/pkg/ast" @@ -332,6 +333,9 @@ var typeFlags = &typeDesc{ Val: 0, } } + sort.Slice(values, func(i, j int) bool { + return values[i] < values[j] + }) return &prog.FlagsType{ IntTypeCommon: base, Vals: values, -- cgit mrf-deployment