summaryrefslogtreecommitdiff
path: root/test/prove.go
diff options
context:
space:
mode:
authorKeith Randall <keithr@alum.mit.edu>2019-03-08 15:01:32 -0800
committerKeith Randall <khr@golang.org>2019-03-09 00:52:45 +0000
commit83a33d3855e257b383b2a3a10dfd9748ad17cfb4 (patch)
treebbb02b368504c00b5dc20a2d960ff05cb3fb5734 /test/prove.go
parent3cf89e509b21d0f469c4e0a78179b9d2d961c864 (diff)
downloadgo-git-83a33d3855e257b383b2a3a10dfd9748ad17cfb4.tar.gz
cmd/compile: reverse order of slice bounds checks
Turns out this makes the fix for 28797 unnecessary, because this order ensures that the RHS of IsSliceInBounds ops are always nonnegative. The real reason for this change is that it also makes dealing with <0 values easier for reporting values in bounds check panics (issue #30116). Makes cmd/go negligibly smaller. Update #28797 Change-Id: I1f25ba6d2b3b3d4a72df3105828aa0a4b629ce85 Reviewed-on: https://go-review.googlesource.com/c/go/+/166377 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'test/prove.go')
-rw-r--r--test/prove.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/prove.go b/test/prove.go
index eb0fb2a15e..2db0a841e2 100644
--- a/test/prove.go
+++ b/test/prove.go
@@ -269,7 +269,7 @@ func f11b(a []int, i int) {
func f11c(a []int, i int) {
useSlice(a[:i])
- useSlice(a[:i]) // ERROR "Proved Geq64$" "Proved IsSliceInBounds$"
+ useSlice(a[:i]) // ERROR "Proved IsSliceInBounds$"
}
func f11d(a []int, i int) {
@@ -469,7 +469,7 @@ func f17(b []int) {
// using the derived relation between len and cap.
// This depends on finding the contradiction, since we
// don't query this condition directly.
- useSlice(b[:i]) // ERROR "Proved Geq64$" "Proved IsSliceInBounds$"
+ useSlice(b[:i]) // ERROR "Proved IsSliceInBounds$"
}
}