We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please answer these questions before submitting your issue. Thanks!
go version
go env
// example4.go package main import "math/rand" func fa2() { s := []int{0, 1, 2, 3, 4, 5, 6} index := rand.Intn(7) _ = s[index:] // line 9: bounds check _ = s[:index] // line 10: bounds check eliminatd! } func fb2(s []int, index int) { _ = s[index:] // line 14: bounds check _ = s[:index] // line 15: bounds check // not clever enough? } func fc2() { s := []int{0, 1, 2, 3, 4, 5, 6} s = s[:4] index := rand.Intn(7) _ = s[index:] // line 22: bounds check _ = s[:index] // line 23: bounds check eliminatd! } func main() {} go build -gcflags="-d=ssa/check_bce/debug=1" example4.go # command-line-arguments ./11.go:9: Found IsSliceInBounds ./11.go:14: Found IsSliceInBounds ./11.go:15: Found IsSliceInBounds ./11.go:22: Found IsSliceInBounds
BCE should also applied for line 15.
BCE is not applied for line 15.
The text was updated successfully, but these errors were encountered:
cc @brtzsnr
Sorry, something went wrong.
Thanks for reporting. Definitely not smart enough:
v10 = SliceLen <int> v6 v11 = SliceCap <int> v6 v12 = IsSliceInBounds <bool> v7 v10 v32 = IsSliceInBounds <bool> v7 v11
Implication v12 -> v32 is not seen by the prove pass. This is a shortcoming of the current algorithm.
CL https://golang.org/cl/33633 mentions this issue.
73f92f9
No branches or pull requests
Please answer these questions before submitting your issue. Thanks!
go version
)?go1.7
go env
)?linux/amd64
BCE should also applied for line 15.
BCE is not applied for line 15.
The text was updated successfully, but these errors were encountered: