diff options
author | Robert Griesemer <gri@golang.org> | 2021-01-28 14:29:25 -0800 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2021-01-30 00:36:53 +0000 |
commit | a59cb5109d49ac0dc09337449b9c7760ecc66c0e (patch) | |
tree | 02ca11cbef50e9b41ab1448a68810e2014284841 /src/cmd/compile/internal/types/size.go | |
parent | 507e641963c6e4277ae4bc9d5f44469d2b4c9c8f (diff) | |
download | go-a59cb5109d49ac0dc09337449b9c7760ecc66c0e.tar.gz go-a59cb5109d49ac0dc09337449b9c7760ecc66c0e.zip |
[dev.typeparams] cmd/compile/internal/types2: handle untyped constant arithmetic overflow
Factor out the existing "constant representation" check after
untyped constant arithmetic and combine with an overflow check.
Use a better heuristic for determining the error position if we
know the error is for a constant operand that is the result of an
arithmetic expression.
Related cleanups.
With this change, untyped constant arithmetic reports an error
when (integer) constants become too large (> 2048 bits). Before,
such arithmetic was only limited by space and time.
Change-Id: Id3cea66c8ba697ff4c7fd1e848f350d9713e3c75
Reviewed-on: https://go-review.googlesource.com/c/go/+/287832
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types/size.go')
0 files changed, 0 insertions, 0 deletions