aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2015-11-20 22:48:47 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2015-11-20 22:48:47 +0000
commit4944c7791b76f813aaf33da27c92df8704adec06 (patch)
tree033bb68bb7eed885459b3614d231f8a68119aaf2 /libgo
parent478c6ec6323711142863f8ac4e6c553433dad378 (diff)
downloadgcc-4944c7791b76f813aaf33da27c92df8704adec06.zip
gcc-4944c7791b76f813aaf33da27c92df8704adec06.tar.gz
gcc-4944c7791b76f813aaf33da27c92df8704adec06.tar.bz2
re PR go/68072 (malformed DWARF TagVariable entry)
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 From-SVN: r230685
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 b64849a..e0b89ec 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__") {