Skip to content

Commit 6b113c0

Browse files
kyakdangopherbot
authored andcommitted
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: 52f69fd GitHub-Pull-Request: #53786 Reviewed-on: https://go-review.googlesource.com/c/go/+/416796 Run-TryBot: Keith Randall <[email protected]> Auto-Submit: Keith Randall <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]> Reviewed-by: Keith Randall <[email protected]> Reviewed-by: Keith Randall <[email protected]>
1 parent 2f10387 commit 6b113c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd/compile/internal/walk/compare.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func walkCompare(n *ir.BinaryExpr, init *ir.Nodes) ir.Node {
116116

117117
switch t.Kind() {
118118
default:
119-
if base.Debug.Libfuzzer != 0 && t.IsInteger() {
119+
if base.Debug.Libfuzzer != 0 && t.IsInteger() && (n.X.Name() == nil || !n.X.Name().Libfuzzer8BitCounter()) {
120120
n.X = cheapExpr(n.X, init)
121121
n.Y = cheapExpr(n.Y, init)
122122

0 commit comments

Comments
 (0)