]> Cypherpunks repositories - gostls13.git/commit
[dev.fuzz] internal/fuzz: add extra []byte mutators
authorRoland Shoemaker <roland@golang.org>
Sun, 25 Apr 2021 15:46:42 +0000 (08:46 -0700)
committerRoland Shoemaker <roland@golang.org>
Tue, 27 Apr 2021 03:22:23 +0000 (03:22 +0000)
commitdd7529408412ec94a454d8455f7547327ee0d64d
treed8538b241a7f2aaed52f7c5451958f36bafdd8c2
parent0b5470f31d8d8cdd49e5754fd1cb5ce391f77bd6
[dev.fuzz] internal/fuzz: add extra []byte mutators

Adds four []byte mutators which:
  * insert a chunk of constant bytes
  * overwirtes a chunk with constant bytes
  * shuffle a range of bytes
  * swaps two chunks

Also updates the 'set byte to random value' mutator to use XOR in
order to avoid a no-op.

Additionally updates the rng call which chooses the []byte mutators
so all the available mutators are used.

Change-Id: I0703518922952f4b1c81b19b196ee91c73b0d5f8
Reviewed-on: https://go-review.googlesource.com/c/go/+/313270
Trust: Roland Shoemaker <roland@golang.org>
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
src/internal/fuzz/mutator.go