Skip to content

Commit 80098ef

Browse files
committed
cmd/compile: don't expand invalid embedded interface
The invalid interface type will be reported already, so don't expand that invalid one, which causes the compiler crashes. Updates #43311 Change-Id: Ic335cfa74f0b9fcfd0929dc5fd31d9156a8f5f5c Reviewed-on: https://go-review.googlesource.com/c/go/+/298710 Trust: Cuong Manh Le <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]>
1 parent 70b277c commit 80098ef

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/cmd/compile/internal/types/size.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func expandiface(t *Type) {
100100
}
101101

102102
for _, m := range t.Methods().Slice() {
103-
if m.Sym != nil {
103+
if m.Sym != nil || m.Type == nil {
104104
continue
105105
}
106106

test/fixedbugs/issue20245.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// errorcheck
1+
// errorcheck -d=panic
22

33
// Copyright 2017 The Go Authors. All rights reserved.
44
// Use of this source code is governed by a BSD-style

test/fixedbugs/issue22921.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// errorcheck
1+
// errorcheck -d=panic
22

33
// Copyright 2020 The Go Authors. All rights reserved.
44
// Use of this source code is governed by a BSD-style

test/fixedbugs/issue27938.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// errorcheck
1+
// errorcheck -d=panic
22

33
// Copyright 2018 The Go Authors. All rights reserved.
44
// Use of this source code is governed by a BSD-style

0 commit comments

Comments
 (0)