Commit 4944c779 by Ian Lance Taylor

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
parent 478c6ec6
d52835c9376985f92f35c32af5f1808239981536 128d5b14b8ab967cb61c01a9b2c596bda7d04c63
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -490,6 +490,11 @@ func (p *Package) loadDWARF(f *File, names []*Name) { ...@@ -490,6 +490,11 @@ func (p *Package) loadDWARF(f *File, names []*Name) {
name, _ := e.Val(dwarf.AttrName).(string) name, _ := e.Val(dwarf.AttrName).(string)
typOff, _ := e.Val(dwarf.AttrType).(dwarf.Offset) typOff, _ := e.Val(dwarf.AttrType).(dwarf.Offset)
if name == "" || typOff == 0 { 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") fatalf("malformed DWARF TagVariable entry")
} }
if !strings.HasPrefix(name, "__cgo__") { if !strings.HasPrefix(name, "__cgo__") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment