1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:17:44 +00:00

LibELF: Don't use assignments in return statements

Sure, this saves a couple of characters, but it's probably not
the best style.
This commit is contained in:
Gunnar Beutner 2021-05-10 20:49:27 +02:00 committed by Andreas Kling
parent 9909a3f015
commit 461acda76f

View file

@ -141,13 +141,15 @@ bool Image::parse()
if (m_size < sizeof(Elf32_Ehdr) || !validate_elf_header(header(), m_size, m_verbose_logging)) {
if (m_verbose_logging)
dbgln("ELF::Image::parse(): ELF Header not valid");
return m_valid = false;
m_valid = false;
return false;
}
if (!validate_program_headers(header(), m_size, m_buffer, m_size, nullptr, m_verbose_logging)) {
if (m_verbose_logging)
dbgln("ELF::Image::parse(): ELF Program Headers not valid");
return m_valid = false;
m_valid = false;
return false;
}
m_valid = true;
@ -156,8 +158,10 @@ bool Image::parse()
for (unsigned i = 0; i < section_count(); ++i) {
auto& sh = section_header(i);
if (sh.sh_type == SHT_SYMTAB) {
if (m_symbol_table_section_index && m_symbol_table_section_index != i)
return m_valid = false;
if (m_symbol_table_section_index && m_symbol_table_section_index != i) {
m_valid = false;
return false;
}
m_symbol_table_section_index = i;
}
if (sh.sh_type == SHT_STRTAB && i != header().e_shstrndx) {