summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/Object/Object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/lib/Object/Object.cpp')
-rw-r--r--contrib/llvm/lib/Object/Object.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/llvm/lib/Object/Object.cpp b/contrib/llvm/lib/Object/Object.cpp
index 5c4b7a6..b44c1a1 100644
--- a/contrib/llvm/lib/Object/Object.cpp
+++ b/contrib/llvm/lib/Object/Object.cpp
@@ -98,8 +98,10 @@ void LLVMMoveToNextSection(LLVMSectionIteratorRef SI) {
void LLVMMoveToContainingSection(LLVMSectionIteratorRef Sect,
LLVMSymbolIteratorRef Sym) {
- if (std::error_code ec = (*unwrap(Sym))->getSection(*unwrap(Sect)))
+ ErrorOr<section_iterator> SecOrErr = (*unwrap(Sym))->getSection();
+ if (std::error_code ec = SecOrErr.getError())
report_fatal_error(ec.message());
+ *unwrap(Sect) = *SecOrErr;
}
// ObjectFile Symbol iterators
OpenPOWER on IntegriCloud