aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-20 22:48:47 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-20 22:48:47 +0000
commitf5244ccbea730f4b6b14c66512554a54f40763e2 (patch)
tree033bb68bb7eed885459b3614d231f8a68119aaf2 /libgo
parent35543da8625d845ce6afb3f82da09f7493ed78a3 (diff)
PR go/68072
cmd/cgo: ignore vars with no name or type if they have a AttrSpecification Backport of master CL https://golang.org/cl/17151. Fixes https://gcc.gnu.org/PR/68072. Reviewed-on: https://go-review.googlesource.com/17152 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230685 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r--libgo/go/cmd/cgo/gcc.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/libgo/go/cmd/cgo/gcc.go b/libgo/go/cmd/cgo/gcc.go
index b64849a8d16..e0b89ec14cb 100644
--- a/libgo/go/cmd/cgo/gcc.go
+++ b/libgo/go/cmd/cgo/gcc.go
@@ -490,6 +490,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__") {