runtime: avoid overflow in (*mheap).grow
Currently when checking if we can grow the heap into the current arena, we do an addition which may overflow. This is particularly likely on 32-bit systems. Avoid this situation by explicitly checking for overflow, and adding in some comments about when overflow is possible, when it isn't, and why. For #35954. Change-Id: I2d4ecbb1ccbd43da55979cc721f0cd8d1757add2 Reviewed-on: https://go-review.googlesource.com/c/go/+/231337 Reviewed-by:Austin Clements <austin@google.com> Reviewed-by:
David Chase <drchase@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Loading
Please sign in to comment