diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:06:29 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:06:29 +0000 | 
| commit | 94994d372d014ce4c8758b9605d63fae651bd8aa (patch) | |
| tree | 51c0b708bd59f205d6b35cb2a8c24d62f0c33d77 /source/Plugins/ObjectFile/ELF/ELFHeader.cpp | |
| parent | 39be7ce23363d12ae3e49aeb1fdb2bfeb892e836 (diff) | |
Notes
Diffstat (limited to 'source/Plugins/ObjectFile/ELF/ELFHeader.cpp')
| -rw-r--r-- | source/Plugins/ObjectFile/ELF/ELFHeader.cpp | 29 | 
1 files changed, 13 insertions, 16 deletions
diff --git a/source/Plugins/ObjectFile/ELF/ELFHeader.cpp b/source/Plugins/ObjectFile/ELF/ELFHeader.cpp index 16cbb6e5753b..3d4735286bf2 100644 --- a/source/Plugins/ObjectFile/ELF/ELFHeader.cpp +++ b/source/Plugins/ObjectFile/ELF/ELFHeader.cpp @@ -38,7 +38,7 @@ static bool GetMaxU64(const lldb_private::DataExtractor &data,    lldb::offset_t saved_offset = *offset;    for (uint32_t i = 0; i < count; ++i, ++value) { -    if (GetMaxU64(data, offset, value, byte_size) == false) { +    if (!GetMaxU64(data, offset, value, byte_size)) {        *offset = saved_offset;        return false;      } @@ -60,7 +60,7 @@ static bool GetMaxS64(const lldb_private::DataExtractor &data,    lldb::offset_t saved_offset = *offset;    for (uint32_t i = 0; i < count; ++i, ++value) { -    if (GetMaxS64(data, offset, value, byte_size) == false) { +    if (!GetMaxS64(data, offset, value, byte_size)) {        *offset = saved_offset;        return false;      } @@ -133,7 +133,7 @@ bool ELFHeader::Parse(lldb_private::DataExtractor &data,      return false;    // Read e_entry, e_phoff and e_shoff. -  if (GetMaxU64(data, offset, &e_entry, byte_size, 3) == false) +  if (!GetMaxU64(data, offset, &e_entry, byte_size, 3))      return false;    // Read e_flags. @@ -232,11 +232,11 @@ bool ELFSectionHeader::Parse(const lldb_private::DataExtractor &data,      return false;    // Read sh_flags. -  if (GetMaxU64(data, offset, &sh_flags, byte_size) == false) +  if (!GetMaxU64(data, offset, &sh_flags, byte_size))      return false;    // Read sh_addr, sh_off and sh_size. -  if (GetMaxU64(data, offset, &sh_addr, byte_size, 3) == false) +  if (!GetMaxU64(data, offset, &sh_addr, byte_size, 3))      return false;    // Read sh_link and sh_info. @@ -244,7 +244,7 @@ bool ELFSectionHeader::Parse(const lldb_private::DataExtractor &data,      return false;    // Read sh_addralign and sh_entsize. -  if (GetMaxU64(data, offset, &sh_addralign, byte_size, 2) == false) +  if (!GetMaxU64(data, offset, &sh_addralign, byte_size, 2))      return false;    return true; @@ -332,7 +332,7 @@ bool ELFSymbol::Parse(const lldb_private::DataExtractor &data,    if (parsing_32) {      // Read st_value and st_size. -    if (GetMaxU64(data, offset, &st_value, byte_size, 2) == false) +    if (!GetMaxU64(data, offset, &st_value, byte_size, 2))        return false;      // Read st_info and st_other. @@ -376,7 +376,7 @@ bool ELFProgramHeader::Parse(const lldb_private::DataExtractor &data,    if (parsing_32) {      // Read p_offset, p_vaddr, p_paddr, p_filesz and p_memsz. -    if (GetMaxU64(data, offset, &p_offset, byte_size, 5) == false) +    if (!GetMaxU64(data, offset, &p_offset, byte_size, 5))        return false;      // Read p_flags. @@ -384,7 +384,7 @@ bool ELFProgramHeader::Parse(const lldb_private::DataExtractor &data,        return false;      // Read p_align. -    if (GetMaxU64(data, offset, &p_align, byte_size) == false) +    if (!GetMaxU64(data, offset, &p_align, byte_size))        return false;    } else {      // Read p_flags. @@ -392,7 +392,7 @@ bool ELFProgramHeader::Parse(const lldb_private::DataExtractor &data,        return false;      // Read p_offset, p_vaddr, p_paddr, p_filesz, p_memsz and p_align. -    if (GetMaxU64(data, offset, &p_offset, byte_size, 6) == false) +    if (!GetMaxU64(data, offset, &p_offset, byte_size, 6))        return false;    } @@ -420,10 +420,7 @@ bool ELFRel::Parse(const lldb_private::DataExtractor &data,    const unsigned byte_size = data.GetAddressByteSize();    // Read r_offset and r_info. -  if (GetMaxU64(data, offset, &r_offset, byte_size, 2) == false) -    return false; - -  return true; +  return GetMaxU64(data, offset, &r_offset, byte_size, 2) != false;  }  //------------------------------------------------------------------------------ @@ -436,11 +433,11 @@ bool ELFRela::Parse(const lldb_private::DataExtractor &data,    const unsigned byte_size = data.GetAddressByteSize();    // Read r_offset and r_info. -  if (GetMaxU64(data, offset, &r_offset, byte_size, 2) == false) +  if (!GetMaxU64(data, offset, &r_offset, byte_size, 2))      return false;    // Read r_addend; -  if (GetMaxS64(data, offset, &r_addend, byte_size) == false) +  if (!GetMaxS64(data, offset, &r_addend, byte_size))      return false;    return true;  | 
