Commit c910fd7b authored by Robert Griesemer's avatar Robert Griesemer
Browse files

[dev.typeparams] cmd/compile: refuse excessively long constants

The compiler uses 512 bit of precision for untyped constant
arithmetic but didn't restrict the length of incoming constant
literals in any way, possibly opening the door for excessively
long constants that could bring compilation to a crawl.

Add a simple check that refuses excessively long constants.
Add test.

Change-Id: I797cb2a8e677b8da2864eb92d686d271ab8a004d
Reviewed-on: https://go-review.googlesource.com/c/go/+/289049


Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: default avatarRobert Findley <rfindley@google.com>
parent 3db6e184
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment