diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-01-18 13:11:07 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-01-18 21:02:24 +0100 |
| commit | d412ea5e8e2e0b9aa2188b82d28243a63bbde0a8 (patch) | |
| tree | 0bf6fe5c548adb06005f78099e970885575153d4 /pkg | |
| parent | 132dcea0af0f14166783f0fd4b0df32bfb91f24a (diff) | |
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.
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/compiler/types.go | 4 |
1 files changed, 4 insertions, 0 deletions
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, |
