mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/cgo: unwrap typedef-chains before type checking
clang can emit some dwarf.VoidType which are wrapped by multiple dwarf.TypedefType. We need to unwrap those before further processing. Fixes #20129 Change-Id: I671ce6aef2dc7b55f1a02aec5f9789ac1b369643 Reviewed-on: https://go-review.googlesource.com/44772 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
e25fdb968c
commit
289a8719ce
3 changed files with 35 additions and 1 deletions
|
|
@ -2286,7 +2286,7 @@ func (c *typeConv) FuncType(dtype *dwarf.FuncType, pos token.Pos) *FuncType {
|
|||
}
|
||||
var r *Type
|
||||
var gr []*ast.Field
|
||||
if _, ok := dtype.ReturnType.(*dwarf.VoidType); ok {
|
||||
if _, ok := base(dtype.ReturnType).(*dwarf.VoidType); ok {
|
||||
gr = []*ast.Field{{Type: c.goVoid}}
|
||||
} else if dtype.ReturnType != nil {
|
||||
r = c.Type(unqual(dtype.ReturnType), pos)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue