]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: check for negative upper bound to IsSliceInBounds
authorDavid Chase <drchase@google.com>
Tue, 4 Dec 2018 15:00:16 +0000 (10:00 -0500)
committerDavid Chase <drchase@google.com>
Fri, 7 Dec 2018 23:04:58 +0000 (23:04 +0000)
commitea6259d5e9d57f247b7d877d4d04602b74ae5155
treec4449109691f8e28591b43ac6b023c933e32b540
parent179909f20556262422a8b99c059eacdfcebc48ee
cmd/compile: check for negative upper bound to IsSliceInBounds

IsSliceInBounds(x, y) asserts that y is not negative, but
there were cases where this is not true.  Change code
generation to ensure that this is true when it's not obviously
true.  Prove phase cleans a few of these out.

With this change the compiler text section is 0.06% larger,
that is, not very much.  Benchmarking still TBD, may need
to wait for access to a benchmarking box (next week).

Also corrected run.go to handle '?' in -update_errors output.

Fixes #28797.

Change-Id: Ia8af90bc50a91ae6e934ef973def8d3f398fac7b
Reviewed-on: https://go-review.googlesource.com/c/152477
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/ssa.go
test/fixedbugs/issue28797.go [new file with mode: 0644]
test/loopbce.go
test/prove.go
test/run.go