diff options
Diffstat (limited to 'libgo/go/debug/dwarf/buf.go')
-rw-r--r-- | libgo/go/debug/dwarf/buf.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libgo/go/debug/dwarf/buf.go b/libgo/go/debug/dwarf/buf.go index 53c46eb4b81..2ade0bd76ad 100644 --- a/libgo/go/debug/dwarf/buf.go +++ b/libgo/go/debug/dwarf/buf.go @@ -163,6 +163,17 @@ func (b *buf) addr() uint64 { return 0 } +func (b *buf) unitLength() (length Offset, dwarf64 bool) { + length = Offset(b.uint32()) + if length == 0xffffffff { + dwarf64 = true + length = Offset(b.uint64()) + } else if length >= 0xfffffff0 { + b.error("unit length has reserved value") + } + return +} + func (b *buf) error(s string) { if b.err == nil { b.data = nil |