mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-30 05:24:22 +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:
@ -207,9 +207,10 @@ static void dumpCXXData(const ObjectFile *Obj) {
|
||||
StringRef SecContents;
|
||||
if (error(Sec.getContents(SecContents)))
|
||||
return;
|
||||
uint64_t SymAddress;
|
||||
if (error(Sym.getAddress(SymAddress)))
|
||||
ErrorOr<uint64_t> SymAddressOrErr = Sym.getAddress();
|
||||
if (error(SymAddressOrErr.getError()))
|
||||
return;
|
||||
uint64_t SymAddress = *SymAddressOrErr;
|
||||
uint64_t SecAddress = Sec.getAddress();
|
||||
uint64_t SecSize = Sec.getSize();
|
||||
uint64_t SymOffset = SymAddress - SecAddress;
|
||||
|
Reference in New Issue
Block a user