diff --git a/llvm/lib/Object/XCOFFObjectFile.cpp b/llvm/lib/Object/XCOFFObjectFile.cpp --- a/llvm/lib/Object/XCOFFObjectFile.cpp +++ b/llvm/lib/Object/XCOFFObjectFile.cpp @@ -293,10 +293,11 @@ else OffsetToRaw = toSection32(Sec)->FileOffsetToRawData; - const uint8_t * ContentStart = base() + OffsetToRaw; + const uint8_t *ContentStart = base() + OffsetToRaw; uint64_t SectionSize = getSectionSize(Sec); - if (checkOffset(Data, reinterpret_cast(ContentStart), SectionSize)) - return make_error(); + if (Error E = Binary::checkOffset( + Data, reinterpret_cast(ContentStart), SectionSize)) + return std::move(E); return makeArrayRef(ContentStart,SectionSize); }