Skip to content

Commit 369ea47

Browse files
committed
[Symbolize] Handle error after the notes loop
We always have to check the error, even if we're going to ignore it.
1 parent e08f205 commit 369ea47

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

llvm/lib/DebugInfo/Symbolize/Symbolize.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ Optional<ArrayRef<uint8_t>> getBuildID(const ELFFile<ELFT> *Obj) {
300300
for (auto N : Obj->notes(P, Err))
301301
if (N.getType() == ELF::NT_GNU_BUILD_ID && N.getName() == ELF::ELF_NOTE_GNU)
302302
return N.getDesc();
303+
consumeError(std::move(Err));
303304
}
304305
return {};
305306
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# RUN: yaml2obj %s -o %t
2+
3+
# RUN: llvm-symbolizer --debug-file-directory=%p/Inputs --obj=%t 0x20112f | FileCheck %s
4+
5+
# CHECK: ??
6+
# CHECK-NEXT: ??:0:0
7+
8+
--- !ELF
9+
FileHeader:
10+
Class: ELFCLASS64
11+
Data: ELFDATA2LSB
12+
Type: ET_EXEC
13+
Machine: EM_X86_64
14+
Sections:
15+
- Name: .note.invalid
16+
Type: SHT_NOTE
17+
Flags: [ SHF_ALLOC ]
18+
Content: 0123456789
19+
ProgramHeaders:
20+
- Type: PT_NOTE
21+
Flags: [ PF_R ]
22+
Sections:
23+
- Section: .note.invalid

0 commit comments

Comments
 (0)