]> Cypherpunks.ru repositories - gostls13.git/commit
go/types: report an error for invalid constant values
authorRobert Griesemer <gri@golang.org>
Thu, 19 Nov 2020 01:05:02 +0000 (17:05 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 19 Nov 2020 01:27:31 +0000 (01:27 +0000)
commit96b943a483dca715ea0164644e1192052105881a
tree668f510f5afc24a20e10986383875a454872d8bf
parent35693d037f9d1c30d6de1fafd08e8c923a415ab8
go/types: report an error for invalid constant values

The parser reports syntactic errors in constant literals.
The go/constant package produces an "unknown" value for
syntactically correct numeric constants that are too small
or too large. Check for the unknown value and report an
error rather than silently continuing.

Fixes #42695.

Change-Id: I414214559a285d67ed50184dc750f106960b5620
Reviewed-on: https://go-review.googlesource.com/c/go/+/271377
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/go/types/expr.go
src/go/types/fixedbugs/issue42695.src [new file with mode: 0644]
src/go/types/operand.go