]> Cypherpunks repositories - gostls13.git/commit
[dev.regabi] go/types: handle untyped constant arithmetic overflow
authorRob Findley <rfindley@google.com>
Mon, 8 Feb 2021 23:04:58 +0000 (18:04 -0500)
committerRobert Findley <rfindley@google.com>
Tue, 9 Feb 2021 14:15:25 +0000 (14:15 +0000)
commit1c58fcf7ed917f66e2b7f77f251e7e63ca9630e2
tree83deef446bd0e46d40e9e9198e628ccd962e4b7c
parent493363ccff354ab5ed133f6d5fac942ba6cc034a
[dev.regabi] go/types: handle untyped constant arithmetic overflow

This is a port of CL 287832 for go/types. It differs from that CL in its
handling of position data. Unlike the syntax package, which has a
unified Operation node, go/types checks operations for ast.UnaryExpr,
IncDecStmt, and BinaryExpr. It was simpler to keep the existing position
logic. Notably, this correctly puts the errors on the operator.

Change-Id: Id1e3aefe863da225eb0a9b3628cfc8a5684c0c4f
Reviewed-on: https://go-review.googlesource.com/c/go/+/290569
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Trust: Robert Findley <rfindley@google.com>
src/go/types/expr.go
src/go/types/stdlib_test.go
src/go/types/testdata/const0.src