[go] cmd/compile: actually set a limit of 10 GiB for string constants

0 views
Skip to first unread message

Cherry Mui (Gerrit)

unread,
Apr 24, 2026, 2:04:36 PM (19 hours ago) Apr 24
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Michael Pratt, golang...@luci-project-accounts.iam.gserviceaccount.com, Robert Griesemer, Mark Freeman, golang-co...@googlegroups.com

Cherry Mui submitted the change

Change information

Commit message:
cmd/compile: set the limit of string constants to 1 GiB

CL 761300's decsription said setting a limit of 10 GiB for string
constants, but the code actually set the limit to 10 MiB. 10 MiB
is rather small, and it is reasonable to have string constants of
that size. 10 GiB is unnecessarily too large, as it overflows int
and the address space on 32-bit platforms. Set the limit to 1 GiB,
so can be handled on 32-bit platforms and not arbitrarily small.
Change-Id: I9af08c23ed8ba383e330a3f0fca18eb4943b7579
TryBot-Bypass: Cherry Mui <cher...@google.com>
Reviewed-by: Michael Pratt <mpr...@google.com>
Files:
  • M src/cmd/compile/internal/types2/check_test.go
  • M src/cmd/compile/internal/types2/const.go
  • M src/go/types/check_test.go
  • M src/go/types/const.go
  • M src/internal/types/testdata/fixedbugs/issue78346.go
Change size: M
Delta: 5 files changed, 83 insertions(+), 10 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I9af08c23ed8ba383e330a3f0fca18eb4943b7579
Gerrit-Change-Number: 769180
Gerrit-PatchSet: 5
Gerrit-Owner: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Mark Freeman <markf...@google.com>
Gerrit-Reviewer: Michael Pratt <mpr...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages