From 61890fb1237a3d2c3be809f66dd3f831cd2cc3d2 Mon Sep 17 00:00:00 2001 From: Katie Hockman Date: Tue, 12 Oct 2021 16:45:40 -0400 Subject: internal/fuzz: fix -fuzzminimizetime with 'x' bug Fixes #48928 Change-Id: I3825ec615ab5fc19389ef4c10ad1042005a3761c Reviewed-on: https://go-review.googlesource.com/c/go/+/355450 Trust: Katie Hockman Run-TryBot: Katie Hockman Reviewed-by: Jay Conrod TryBot-Result: Go Bot --- src/internal/fuzz/fuzz.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/internal') diff --git a/src/internal/fuzz/fuzz.go b/src/internal/fuzz/fuzz.go index a8bbd60b1c..03071d5521 100644 --- a/src/internal/fuzz/fuzz.go +++ b/src/internal/fuzz/fuzz.go @@ -825,9 +825,11 @@ func (c *coordinator) peekMinimizeInput() (fuzzMinimizeInput, bool) { } } } - remaining := c.opts.Limit - c.count - c.countWaiting - if input.limit > remaining { - input.limit = remaining + if c.opts.Limit > 0 { + remaining := c.opts.Limit - c.count - c.countWaiting + if input.limit > remaining { + input.limit = remaining + } } return input, true } -- cgit v1.3