golang / go

The Go programming language

Home Page:https://go.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cmd/compile: nil deref

dvyukov opened this issue · comments

go version devel +b61b1d2c57 Sun Mar 18 16:53:53 2018 +0000 linux/amd64

package n
type R interface{S}
type S=interface{R}

go build crash.go

panic: runtime error: invalid memory address or nil pointer dereference

goroutine 1 [running]:
cmd/compile/internal/gc.dowidth()
cmd/compile/internal/types.(*Type).Fields()
cmd/compile/internal/gc.expandiface()
cmd/compile/internal/gc.dowidth()
cmd/compile/internal/types.(*Type).Fields()
cmd/compile/internal/gc.expandiface()
cmd/compile/internal/gc.dowidth()
cmd/compile/internal/gc.resumecheckwidth()
cmd/compile/internal/gc.Main()
main.main()

Found with go-fuzz. #19109

Duplicate of #23823, I'm afraid :)