diff options
author | George Rimar <grimar@accesssoftek.com> | 2019-07-23 11:37:14 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2019-07-23 11:37:14 +0000 |
commit | fccffa871c2654b95f6577a06ed4e2dcdd17a1ed (patch) | |
tree | 33272a4ccf10578c3de56ff29a6da6dc79c1b826 /llvm/tools/yaml2obj | |
parent | aaa682752685b1f3ed7ef90c18480dced27b1c6c (diff) | |
download | llvm-fccffa871c2654b95f6577a06ed4e2dcdd17a1ed.zip llvm-fccffa871c2654b95f6577a06ed4e2dcdd17a1ed.tar.gz llvm-fccffa871c2654b95f6577a06ed4e2dcdd17a1ed.tar.bz2 |
[Object/ELF.h] - Improve testing of the fields in ELFFile<ELFT>::sections().
This eliminates a one error untested and
also introduces a error for one more possible case
which lead to crash previously.
Differential revision: https://reviews.llvm.org/D64987
llvm-svn: 366796
Diffstat (limited to 'llvm/tools/yaml2obj')
-rw-r--r-- | llvm/tools/yaml2obj/yaml2elf.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/tools/yaml2obj/yaml2elf.cpp b/llvm/tools/yaml2obj/yaml2elf.cpp index f3a8a91..c6be508 100644 --- a/llvm/tools/yaml2obj/yaml2elf.cpp +++ b/llvm/tools/yaml2obj/yaml2elf.cpp @@ -244,7 +244,7 @@ void ELFState<ELFT>::initELFHeader(Elf_Ehdr &Header) { // Immediately following the ELF header and program headers. Header.e_shoff = Doc.Header.SHOffset - ? (uint16_t)*Doc.Header.SHOffset + ? (typename ELFT::uint)(*Doc.Header.SHOffset) : sizeof(Header) + sizeof(Elf_Phdr) * Doc.ProgramHeaders.size(); Header.e_shnum = Doc.Header.SHNum ? (uint16_t)*Doc.Header.SHNum : SN2I.size() + 1; |