Skip to content
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

cmd/compile: compiler accepts unsafe.Sizeof([0]byte{}[0]) #12944

Closed
mdempsky opened this issue Oct 15, 2015 · 0 comments
Closed

cmd/compile: compiler accepts unsafe.Sizeof([0]byte{}[0]) #12944

mdempsky opened this issue Oct 15, 2015 · 0 comments

Comments

@mdempsky
Copy link
Member

cmd/compile accepts this program:

package main
import "unsafe"
func main() {
    _ = unsafe.Sizeof([0]byte{}[0])
}

gotype rejects it with foo.go:4:30: index 0 (constant of type int) is out of bounds.

@mdempsky mdempsky changed the title cmd/compile: compiler accepts unsafe.Offsetof([0]byte{}[0]) cmd/compile: compiler accepts unsafe.Sizeof([0]byte{}[0]) Oct 15, 2015
@golang golang locked and limited conversation to collaborators Oct 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants