mirror of
https://github.com/golang/go
synced 2024-11-27 04:31:21 -07:00
cmd/compile: avoid excessive libfuzzer instrumentation of int compares
Do not intercept integer compares that are used to increment libFuzzer's
8-bit counters. This is unnecessary and has a negative impact on the
fuzzing performance. This fixes #53760.
Change-Id: Id22efac968b18014eedabb6f0762e1456897024e
GitHub-Last-Rev: 52f69fd68c
GitHub-Pull-Request: golang/go#53786
Reviewed-on: https://go-review.googlesource.com/c/go/+/416796
Run-TryBot: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
This commit is contained in:
parent
2f103873c5
commit
6b113c0fec
@ -116,7 +116,7 @@ func walkCompare(n *ir.BinaryExpr, init *ir.Nodes) ir.Node {
|
||||
|
||||
switch t.Kind() {
|
||||
default:
|
||||
if base.Debug.Libfuzzer != 0 && t.IsInteger() {
|
||||
if base.Debug.Libfuzzer != 0 && t.IsInteger() && (n.X.Name() == nil || !n.X.Name().Libfuzzer8BitCounter()) {
|
||||
n.X = cheapExpr(n.X, init)
|
||||
n.Y = cheapExpr(n.Y, init)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user