Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 85529a5

Browse files
committed
Revert "[Object, ELF] Fix segmentation fault in ELFFile::getSectionName()."
This reverts commit r239124. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239125 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 83f903f commit 85529a5

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

include/llvm/Object/ELF.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ ErrorOr<StringRef> ELFFile<ELFT>::getSymbolName(const Elf_Shdr *Section,
928928
template <class ELFT>
929929
ErrorOr<StringRef>
930930
ELFFile<ELFT>::getSectionName(const Elf_Shdr *Section) const {
931-
if (!dot_shstrtab_sec || Section->sh_name >= dot_shstrtab_sec->sh_size)
931+
if (Section->sh_name >= dot_shstrtab_sec->sh_size)
932932
return object_error::parse_failed;
933933
return StringRef(getString(dot_shstrtab_sec, Section->sh_name));
934934
}
-52 Bytes
Binary file not shown.

test/DebugInfo/dwarfdump-invalid.test

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,3 @@ RUN: llvm-dwarfdump %p/Inputs/invalid.elf 2>&1 | FileCheck %s --check-prefix=INV
44
RUN: llvm-dwarfdump %p/Inputs/invalid.elf.2 2>&1 | FileCheck %s --check-prefix=INVALID-ELF
55
RUN: llvm-dwarfdump %p/Inputs/invalid.elf.3 2>&1 | FileCheck %s --check-prefix=INVALID-ELF
66
INVALID-ELF: Invalid data was encountered while parsing the file
7-
8-
RUN: llvm-dwarfdump %p/Inputs/invalid.elf.no-shstrtab 2>&1 | FileCheck %s --check-prefix=EMPTY
9-
EMPTY: .debug_info contents:

0 commit comments

Comments
 (0)