-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
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
slice: negative indexing doesn't panics #29629
Comments
Please show us a complete standalone example. If you are using This Go program panics when I run it: package main
type stack []int
func (s *stack) last() int {
return (*s)[len(*s)-1]
}
func last() {
s := stack{}
s.last() // should panics
}
func main() {
last()
} |
Please also test against the most recent patch release: |
If this is fixed in 1.11.4 and tip, it's very likely just a duplicate of #27289, which was backported into 1.11.1. |
If you are still having this problem, please show us a complete standalone example. Thanks. |
With go 1.11.4 panic occurs |
Thanks, so it sounds like this bug has been fixed. |
Well, then it's clearly a duplicate. Thanks for the follow-up. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I try to test some code like this
What did you expect to see?
panic
What did you see instead?
no panic
The text was updated successfully, but these errors were encountered: