]> Cypherpunks repositories - gostls13.git/commit
[dev.fuzz] internal/fuzz: don't panic if types change
authorKatie Hockman <katie@golang.org>
Tue, 27 Apr 2021 18:34:17 +0000 (14:34 -0400)
committerKatie Hockman <katie@golang.org>
Tue, 4 May 2021 18:57:18 +0000 (18:57 +0000)
commitaf3237eaf9cf46e6a02a3b53447e49c55abd4f00
tree6bbedd796ffdc4fcbbcd8c85221ba34e861c9d80
parentfe8c0e9467d8628138d54951ebb8e166c086c80b
[dev.fuzz] internal/fuzz: don't panic if types change

There was a bug where if the types to fuzz were
different from the types in a file in the on-disk
corpus, then the code would panic. We thought
this case was handled, but the final `continue`
in the nested loop still allowed the invalid
entry to be added to the corpus. Pulling the
validation into a helper function makes this
less brittle.

Change-Id: I401346f890ea30ab7cff9640cb555da2e3ff8cc6
Reviewed-on: https://go-review.googlesource.com/c/go/+/313810
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/testdata/script/test_fuzz.txt
src/internal/fuzz/fuzz.go