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 @@ -295,8 +295,9 @@ 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); }