mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +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:
@@ -180,10 +180,10 @@ const char *LLVMGetSymbolName(LLVMSymbolIteratorRef SI) {
|
||||
}
|
||||
|
||||
uint64_t LLVMGetSymbolAddress(LLVMSymbolIteratorRef SI) {
|
||||
uint64_t ret;
|
||||
if (std::error_code ec = (*unwrap(SI))->getAddress(ret))
|
||||
report_fatal_error(ec.message());
|
||||
return ret;
|
||||
ErrorOr<uint64_t> Ret = (*unwrap(SI))->getAddress();
|
||||
if (std::error_code EC = Ret.getError())
|
||||
report_fatal_error(EC.message());
|
||||
return *Ret;
|
||||
}
|
||||
|
||||
uint64_t LLVMGetSymbolSize(LLVMSymbolIteratorRef SI) {
|
||||
|
Reference in New Issue
Block a user