mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/cgo: stop expanding typedefs once we reach __builtin types
Expanding __builtin types (__builtin_va_list, particularly) leads to problems because they are expanded by the compiler itself - the expansions are not generated by anything in a .h file. The types a __builtin type expand to are thus very confusing to cgo. See CL 126275. Change-Id: I66eb6a4f27f652f1b934ba702f580f6daa62a566 Reviewed-on: https://go-review.googlesource.com/127156 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
6b9c782f9f
commit
b8669ef1ce
1 changed files with 4 additions and 0 deletions
|
|
@ -652,6 +652,10 @@ func (p *Package) recordTypedefs1(dtype dwarf.Type, visited map[dwarf.Type]bool)
|
|||
visited[dtype] = true
|
||||
switch dt := dtype.(type) {
|
||||
case *dwarf.TypedefType:
|
||||
if strings.HasPrefix(dt.Name, "__builtin") {
|
||||
// Don't look inside builtin types. There be dragons.
|
||||
return
|
||||
}
|
||||
if !p.typedefs[dt.Name] {
|
||||
p.typedefs[dt.Name] = true
|
||||
p.typedefList = append(p.typedefList, dt.Name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue