diff options
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | libgo/go/debug/dwarf/entry.go | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 7abc213..2e8a992 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -19d94969c5202c07b3b166079b9f4ebbb52dfa6b +1176dd2b53f2d2b826b599a126f3f9828283cec3 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/go/debug/dwarf/entry.go b/libgo/go/debug/dwarf/entry.go index ffa61c28..6be0700 100644 --- a/libgo/go/debug/dwarf/entry.go +++ b/libgo/go/debug/dwarf/entry.go @@ -461,7 +461,18 @@ func (b *buf) entry(atab abbrevTable, ubase Offset) *Entry { case formString: val = b.string() case formStrp: - off := b.uint32() // offset into .debug_str + var off uint64 // offset into .debug_str + is64, known := b.format.dwarf64() + if !known { + b.error("unknown size for DW_FORM_strp") + } else if is64 { + off = b.uint64() + } else { + off = uint64(b.uint32()) + } + if uint64(int(off)) != off { + b.error("DW_FORM_strp offset out of range") + } if b.err != nil { return nil } |