mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
Simplify the logic, NFC.
llvm-svn: 240554
This commit is contained in:
parent
1b3d959d3c
commit
15227e024f
@ -154,25 +154,21 @@ std::error_code COFFObjectFile::getSymbolAddress(DataRefImpl Ref,
|
||||
uint64_t &Result) const {
|
||||
COFFSymbolRef Symb = getCOFFSymbol(Ref);
|
||||
|
||||
if (Symb.isAnyUndefined()) {
|
||||
Result = UnknownAddress;
|
||||
return std::error_code();
|
||||
}
|
||||
if (Symb.isCommon()) {
|
||||
if (Symb.isAnyUndefined() || Symb.isCommon()) {
|
||||
Result = UnknownAddress;
|
||||
return std::error_code();
|
||||
}
|
||||
|
||||
int32_t SectionNumber = Symb.getSectionNumber();
|
||||
if (!COFF::isReservedSectionNumber(SectionNumber)) {
|
||||
const coff_section *Section = nullptr;
|
||||
if (std::error_code EC = getSection(SectionNumber, Section))
|
||||
return EC;
|
||||
|
||||
Result = Section->VirtualAddress + Symb.getValue();
|
||||
if (COFF::isReservedSectionNumber(SectionNumber)) {
|
||||
Result = Symb.getValue();
|
||||
return std::error_code();
|
||||
}
|
||||
|
||||
Result = Symb.getValue();
|
||||
const coff_section *Section = nullptr;
|
||||
if (std::error_code EC = getSection(SectionNumber, Section))
|
||||
return EC;
|
||||
Result = Section->VirtualAddress + Symb.getValue();
|
||||
return std::error_code();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user