mirror of
https://github.com/golang/go
synced 2024-11-26 21:31:32 -07:00
debug/dwarf: skip over zero-length compilation units
DWARF sections generated by mingw-clang seem to include these (not often - only one out of many in the binary that I am looking at). Skipping over them, everything parses correctly. This makes TestDefaultLinkerDWARF pass on windows/arm64. Change-Id: Ie4a7daa1423f51cbc8c4aac88b1d27c3b52ee880 Reviewed-on: https://go-review.googlesource.com/c/go/+/312031 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
parent
cef3a442ea
commit
073f913949
@ -48,8 +48,10 @@ func (d *Data) parseUnits() ([]unit, error) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
b.skip(int(len))
|
b.skip(int(len))
|
||||||
|
if len > 0 {
|
||||||
nunit++
|
nunit++
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if b.err != nil {
|
if b.err != nil {
|
||||||
return nil, b.err
|
return nil, b.err
|
||||||
}
|
}
|
||||||
@ -61,7 +63,9 @@ func (d *Data) parseUnits() ([]unit, error) {
|
|||||||
u := &units[i]
|
u := &units[i]
|
||||||
u.base = b.off
|
u.base = b.off
|
||||||
var n Offset
|
var n Offset
|
||||||
|
for n == 0 {
|
||||||
n, u.is64 = b.unitLength()
|
n, u.is64 = b.unitLength()
|
||||||
|
}
|
||||||
dataOff := b.off
|
dataOff := b.off
|
||||||
vers := b.uint16()
|
vers := b.uint16()
|
||||||
if vers < 2 || vers > 5 {
|
if vers < 2 || vers > 5 {
|
||||||
|
Loading…
Reference in New Issue
Block a user