mirror of https://github.com/stella-emu/stella.git
Style, paranoia.
This commit is contained in:
parent
21921584ed
commit
9cc43a80e5
|
@ -175,10 +175,19 @@ const ElfParser::Section* ElfParser::getSymtab() const
|
|||
|
||||
const ElfParser::Section* ElfParser::getStrtab() const
|
||||
{
|
||||
for (size_t i = 0; i < sections.size(); i++)
|
||||
if (sections[i].type == SHT_STRTAB && i != header.shstrIndex) return §ions[i];
|
||||
const Section* strtab = nullptr;
|
||||
size_t count = 0;
|
||||
|
||||
return nullptr;
|
||||
for (size_t i = 0; i < sections.size(); i++) {
|
||||
if (sections[i].type != SHT_STRTAB || i == header.shstrIndex) continue;
|
||||
|
||||
strtab = §ions[i];
|
||||
count++;
|
||||
}
|
||||
|
||||
if (count > 1) EInvalidElf::raise("more than one symbol table");
|
||||
|
||||
return strtab;
|
||||
}
|
||||
|
||||
ostream& operator<<(ostream& os, const ElfParser::Section& section)
|
||||
|
|
|
@ -135,7 +135,6 @@ class ElfParser {
|
|||
};
|
||||
|
||||
ostream& operator<<(ostream& os, const ElfParser::Section& section);
|
||||
|
||||
ostream& operator<<(ostream& os, const ElfParser::Symbol symbol);
|
||||
|
||||
#endif // ELF_PARSER
|
||||
|
|
Loading…
Reference in New Issue