]> Cypherpunks repositories - gostls13.git/commit
reflect: avoid a bounds check in stack-constrained code
authorKeith Randall <khr@golang.org>
Thu, 24 Jul 2025 23:41:23 +0000 (16:41 -0700)
committerKeith Randall <khr@golang.org>
Fri, 25 Jul 2025 16:45:13 +0000 (09:45 -0700)
commit91c4f0ccd542a505f72ad0db952f55688851e49e
tree48ed65ede34a04b1e435af0c1e301695baacdc9c
parent3636ced112d89da03739fa7d5468c0270addaa28
reflect: avoid a bounds check in stack-constrained code

Since CL 682496 we need more stack space to handle bounds checks.
The code modified here normally has no bounds checks, but in -N
builds it still does and thus uses too much stack.

Use unsafe arithmetic to avoid the bounds check.

This will hopefully fix some of the arm64 linux builders.

Change-Id: I5b3096a14b4fb9553e635b7f340e60b8ffba8755
Reviewed-on: https://go-review.googlesource.com/c/go/+/690415
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@google.com>
src/reflect/makefunc.go