diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-01-18 20:57:47 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-01-18 21:02:24 +0100 |
| commit | 2fd6bd0d1b46dd17621c1c4a7ae167341e07620e (patch) | |
| tree | e424e8f45e78dd2925a6b8b759dbdc22ff0ddb9c | |
| parent | de577addbf322eaa76ab50478593df7b11f197ff (diff) | |
prog: reduce len mutation priority
Mutating LenType only produces "incorrect" results according to descriptions,
we generally try to do it less often (there is infinite space of incorrect inputs).
| -rw-r--r-- | prog/mutation.go | 3 | ||||
| -rw-r--r-- | prog/size.go | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/prog/mutation.go b/prog/mutation.go index 7868c6445..f70a62cbe 100644 --- a/prog/mutation.go +++ b/prog/mutation.go @@ -629,7 +629,8 @@ func (t *VmaType) getMutationPrio(target *Target, arg Arg, ignoreSpecial bool) ( } func (t *LenType) getMutationPrio(target *Target, arg Arg, ignoreSpecial bool) (prio float64, stopRecursion bool) { - return 0.6 * maxPriority, false + // Mutating LenType only produces "incorrect" results according to descriptions. + return 0.1 * maxPriority, false } func (t *BufferType) getMutationPrio(target *Target, arg Arg, ignoreSpecial bool) (prio float64, stopRecursion bool) { diff --git a/prog/size.go b/prog/size.go index 8f7f15d4e..b621cb6bc 100644 --- a/prog/size.go +++ b/prog/size.go @@ -175,7 +175,7 @@ func (r *randGen) mutateSize(arg *ConstArg, parent []Arg) bool { if arg.Val != 0 && r.bin() { arg.Val = r.randRangeInt(0, arg.Val-1, arg.Type().TypeBitSize(), 0) } else { - arg.Val = r.randRangeInt(arg.Val+1, arg.Val+1000, arg.Type().TypeBitSize(), 0) + arg.Val = r.randRangeInt(arg.Val+1, arg.Val+100, arg.Type().TypeBitSize(), 0) } return true } |
