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