go/types: compiling hangs
dvyukov opened this issue · 6 comments
dvyukov commented
The following program takes 1+ hours to compile, aborted after that:
package a
var g = 1e81391777742999
Package should either analyze it in a reasonable amount of time (seconds) or give an error if it cannot chew it. Compiling a single line of code for hours does not make sense.
on commit af81789
dvyukov commented
I propose that gc/types employ exactly the same logic as gc compiler:
https://go-review.googlesource.com/#/c/11673/1/src/cmd/compile/internal/gc/mparith3.go
0xmohit commented
Both go tool vet
and the command vet
hang in this case.
rsc commented
This one is important. @griesemer, can you take a look? Thanks.
griesemer commented
Started.
griesemer commented
The largest decimal exponent that needs to be accepted is 646456992 (approx. 2**MaxInt32). See also issue #11326.
gopherbot commented
CL https://golang.org/cl/17360 mentions this issue.