aboutsummaryrefslogtreecommitdiff
path: root/test/prove.go
diff options
context:
space:
mode:
authorKeith Randall <khr@google.com>2018-07-02 15:21:35 -0700
committerKeith Randall <khr@golang.org>2018-07-09 18:23:39 +0000
commit58d287e5e863cd8d3c3525e1a04e424e748cf242 (patch)
treedf0d5ffeab78593f18073b764bccded84e62a9a5 /test/prove.go
parent9b7a8aaaf3adbc330ef724fb581b3bfa72ab2a49 (diff)
downloadgo-58d287e5e863cd8d3c3525e1a04e424e748cf242.tar.gz
go-58d287e5e863cd8d3c3525e1a04e424e748cf242.zip
cmd/compile: ensure that loop condition is detected correctly
We need to make sure that the terminating comparison has the right sense given the increment direction. If the increment is positive, the terminating comparsion must be < or <=. If the increment is negative, the terminating comparison must be > or >=. Do a few cleanups, like constant-folding entry==0, adding comments, removing unused "exported" fields. Fixes #26116 Change-Id: I14230ee8126054b750e2a1f2b18eb8f09873dbd5 Reviewed-on: https://go-review.googlesource.com/121940 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
Diffstat (limited to 'test/prove.go')
-rw-r--r--test/prove.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/prove.go b/test/prove.go
index 9de7d1b3fc..45cee9e8b5 100644
--- a/test/prove.go
+++ b/test/prove.go
@@ -622,7 +622,7 @@ func natcmp(x, y []uint) (r int) {
}
i := m - 1
- for i > 0 && // ERROR "Induction variable: limits \(0,\?\], increment -1"
+ for i > 0 && // ERROR "Induction variable: limits \(0,\?\], increment 1"
x[i] == // ERROR "Proved IsInBounds$"
y[i] { // ERROR "Proved IsInBounds$"
i--