mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 23:24:59 +00:00
Return ErrorOr from getSymbolAddress.
It can fail trying to get the section on ELF and COFF. This makes sure the error is handled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241366 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -161,8 +161,10 @@ static std::error_code
|
||||
resolveSectionAndAddress(const COFFObjectFile *Obj, const SymbolRef &Sym,
|
||||
const coff_section *&ResolvedSection,
|
||||
uint64_t &ResolvedAddr) {
|
||||
if (std::error_code EC = Sym.getAddress(ResolvedAddr))
|
||||
ErrorOr<uint64_t> ResolvedAddrOrErr = Sym.getAddress();
|
||||
if (std::error_code EC = ResolvedAddrOrErr.getError())
|
||||
return EC;
|
||||
ResolvedAddr = *ResolvedAddrOrErr;
|
||||
section_iterator iter(Obj->section_begin());
|
||||
if (std::error_code EC = Sym.getSection(iter))
|
||||
return EC;
|
||||
|
Reference in New Issue
Block a user