[PATCH] D98739: [Object][MachO] Handle end iterator in getSymbolType()

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 17 15:07:06 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG991df7333d4a: [Object][MachO] Handle end iterator in getSymbolType() (authored by steven_wu).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98739

Files:
  llvm/lib/Object/MachOObjectFile.cpp


Index: llvm/lib/Object/MachOObjectFile.cpp
===================================================================
--- llvm/lib/Object/MachOObjectFile.cpp
+++ llvm/lib/Object/MachOObjectFile.cpp
@@ -1836,6 +1836,8 @@
       if (!SecOrError)
         return SecOrError.takeError();
       section_iterator Sec = *SecOrError;
+      if (Sec == section_end())
+        return SymbolRef::ST_Other;
       if (Sec->isData() || Sec->isBSS())
         return SymbolRef::ST_Data;
       return SymbolRef::ST_Function;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98739.331389.patch
Type: text/x-patch
Size: 506 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210317/e0938e8f/attachment.bin>


More information about the llvm-commits mailing list