]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.11] 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)
committerFilippo Valsorda <filippo@golang.org>
Fri, 14 Dec 2018 18:23:41 +0000 (18:23 +0000)
commitbdc7d5677edd1dab21cdaa1f6498e0c2a6c9d7bf
tree6292ddd7ad8710cb0df07c24cde1c4f0fb875c22
parentb86522faa54413930d6e9164973166490babc5de
[release-branch.go1.11] 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 #28799.

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>
(cherry picked from commit ea6259d5e9d57f247b7d877d4d04602b74ae5155)
Reviewed-on: https://go-review.googlesource.com/c/153638
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