]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/gc: avoid spurious div-zero errors
authorRobert Griesemer <gri@golang.org>
Tue, 21 Apr 2015 17:39:21 +0000 (10:39 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 13 May 2015 17:38:13 +0000 (17:38 +0000)
commit99475dfb5923b775a9ab587ad99cb64de5d1f51c
tree68e7cc6d61df74fbecde20604842971c8ffd0898
parentc4fe503119ee517e202e81913f08b2e9940e1a72
cmd/internal/gc: avoid spurious div-zero errors

Set overflowing integer constants to 1 rather than 0 to avoid
spurious div-zero errors in subsequent constant expressions.

Also: Exclude new test case from go/types test since it's
running too long (go/types doesn't have an upper constant
size limit at the moment).

Fixes #7746.

Change-Id: I3768488ad9909a3cf995247b81ee78a8eb5a1e41
Reviewed-on: https://go-review.googlesource.com/9165
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/internal/gc/const.go
src/cmd/internal/gc/mparith2.go
src/go/types/stdlib_test.go
test/fixedbugs/issue7746.go [new file with mode: 0644]