Commit 4a1b8146 authored by Robert Griesemer's avatar Robert Griesemer

go/printer: don't use 'infinity' value when it might lead to int32 overflow

Fixes 386 build breakage.

R=rsc
CC=golang-dev
https://golang.org/cl/6844091
parent 127d2bf7
......@@ -1431,11 +1431,11 @@ func (p *printer) bodySize(b *ast.BlockStmt, maxSize int) int {
pos2 := b.Rbrace
if pos1.IsValid() && pos2.IsValid() && p.lineFor(pos1) != p.lineFor(pos2) {
// opening and closing brace are on different lines - don't make it a one-liner
return infinity
return maxSize + 1
}
if len(b.List) > 5 || p.commentBefore(p.posFor(pos2)) {
// too many statements or there is a comment inside - don't make it a one-liner
return infinity
return maxSize + 1
}
// otherwise, estimate body size
bodySize := 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment