mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/cgo: ignore vars with no name or type if they have a AttrSpecification
Fixes #13344. Change-Id: I33c6721fd33d144c85c87840ddf27ce15aa72328 Reviewed-on: https://go-review.googlesource.com/17151 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Minux Ma <minux@golang.org>
This commit is contained in:
parent
5951823853
commit
0417872809
2 changed files with 10 additions and 0 deletions
|
|
@ -491,6 +491,11 @@ func (p *Package) loadDWARF(f *File, names []*Name) {
|
|||
name, _ := e.Val(dwarf.AttrName).(string)
|
||||
typOff, _ := e.Val(dwarf.AttrType).(dwarf.Offset)
|
||||
if name == "" || typOff == 0 {
|
||||
if e.Val(dwarf.AttrSpecification) != nil {
|
||||
// Since we are reading all the DWARF,
|
||||
// assume we will see the variable elsewhere.
|
||||
break
|
||||
}
|
||||
fatalf("malformed DWARF TagVariable entry")
|
||||
}
|
||||
if !strings.HasPrefix(name, "__cgo__") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue