]> Cypherpunks repositories - gostls13.git/commit
runtime: throw on zero-sized range passed to addrRanges.add
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 15 Jul 2020 18:56:39 +0000 (18:56 +0000)
committerMichael Knyszek <mknyszek@google.com>
Fri, 23 Oct 2020 23:01:26 +0000 (23:01 +0000)
commitfe70866d1dc8c44ab19180ecab2b5c5b8628265a
treeaec5f77935fdf60eaf9f35834f50489eabb06d38
parente01a1c01f830e2398b773b803dce3238b1107ce9
runtime: throw on zero-sized range passed to addrRanges.add

addrRanges represents a set of addresses. Currently, passing in a
zero-sized range will cause that range to be added to the list, even
though it doesn't represent any address (addrRanges.contains will still
always return false, and findSucc will give surprising results).

We could ignore this input, but it's almost always a bug for the calling
code to pass in a zero-sized range, so just throw.

Change-Id: I8ed09e15b79a3a33e2d0cf5ed55f9e497388e7a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/242817
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/mranges.go