[PATCH] D109567: [XCOFF] Fix the program abortion issue.

Esme Yi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 13 00:55:29 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGea81898d0fe2: [XCOFF] Fix the program abortion issue in XCOFFObjectFile::getSectionContents. (authored by Esme).

Changed prior to commit:
  https://reviews.llvm.org/D109567?vs=371785&id=372175#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109567/new/

https://reviews.llvm.org/D109567

Files:
  llvm/lib/Object/XCOFFObjectFile.cpp


Index: llvm/lib/Object/XCOFFObjectFile.cpp
===================================================================
--- llvm/lib/Object/XCOFFObjectFile.cpp
+++ 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<uintptr_t>(ContentStart), SectionSize))
-    return make_error<BinaryError>();
+  if (Error E = Binary::checkOffset(
+          Data, reinterpret_cast<uintptr_t>(ContentStart), SectionSize))
+    return std::move(E);
 
   return makeArrayRef(ContentStart,SectionSize);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109567.372175.patch
Type: text/x-patch
Size: 630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210913/1001e52c/attachment.bin>


More information about the llvm-commits mailing list