Skip to content

cmd/compile: crashes in slicing array converted from slice #46907

@zigo101

Description

@zigo101

What version of Go are you using (go version)?

$ go version
go version go1.17beta1 linux/amd64

What did you do?

package main

func SumPointer(b []byte) []byte {
	return (*[32]byte)(b[:32])[:]
}

func main() {
}

What did you expect to see?

Compiles okay.

What did you see instead?

Compiler crashes.

# command-line-arguments
./main.go:4:28: internal compiler error: 'SumPointer': bad type in slice int


Please file a bug report including a short program that triggers the error.
https://golang.org/issue/new

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.release-blocker

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions