]> Cypherpunks repositories - gostls13.git/commit
runtime: fix overflow in PingPongHog test
authorKeith Randall <khr@golang.org>
Thu, 19 May 2022 20:45:51 +0000 (13:45 -0700)
committerKeith Randall <khr@golang.org>
Thu, 19 May 2022 21:33:15 +0000 (21:33 +0000)
commitd8762b2f4532cc2e5ec539670b88bbc469a13938
treec447b02619b0309dc43e22598ef7a279df8c60e8
parentdd83fd8a70d324be96d2fcac753b202db0625538
runtime: fix overflow in PingPongHog test

On 32-bit systems the result of hogCount*factor can overflow.
Use division instead to do comparison.

Update #52207

Change-Id: I429fb9dc009af645acb535cee5c70887527ba207
Reviewed-on: https://go-review.googlesource.com/c/go/+/407415
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Keith Randall <khr@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
src/runtime/proc_test.go