mirror of
https://github.com/go-delve/delve.git
synced 2025-10-29 01:27:16 +08:00
godwarf: handle unsupported types gracefully (#2106)
Backport https://go-review.googlesource.com/c/go/+/158797 from upstream. Fixes #2101
This commit is contained in:
committed by
GitHub
parent
c63ae072bc
commit
8571fddbc1
@ -323,3 +323,17 @@ func TestIssue1636_InlineWithoutOrigin(t *testing.T) {
|
||||
dwb.TagClose()
|
||||
fakeBinaryInfo(t, dwb)
|
||||
}
|
||||
|
||||
func TestUnsupportedType(t *testing.T) {
|
||||
// Tests that reading an unsupported type does not cause an error
|
||||
dwb := dwarfbuilder.New()
|
||||
dwb.AddCompileUnit("main", 0x0)
|
||||
off := dwb.TagOpen(dwarf.TagReferenceType, "blah")
|
||||
dwb.TagClose()
|
||||
dwb.TagClose()
|
||||
_, dw := fakeBinaryInfo(t, dwb)
|
||||
_, err := godwarf.ReadType(dw, 0, off, make(map[dwarf.Offset]godwarf.Type))
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error reading unsupported type: %#v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user