[PATCH] D110040: [lld-macho] Don't replace local personality symbol with LazySymbol

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 20 09:38:07 PDT 2021


oontvoo updated this revision to Diff 373626.
oontvoo marked an inline comment as done.
oontvoo added a comment.

remove spurious const/const_cast


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110040

Files:
  lld/MachO/UnwindInfoSection.cpp


Index: lld/MachO/UnwindInfoSection.cpp
===================================================================
--- lld/MachO/UnwindInfoSection.cpp
+++ lld/MachO/UnwindInfoSection.cpp
@@ -194,8 +194,9 @@
         //
         // (See discussions/alternatives already considered on D107533)
         if (!defined->isExternal())
-          if (const Symbol *sym = symtab->find(defined->getName()))
-            r.referent = s = const_cast<Symbol *>(sym);
+          if (Symbol *sym = symtab->find(defined->getName()))
+            if (sym->kind() != Symbol::LazyKind)
+              r.referent = s = sym;
       }
       if (auto *undefined = dyn_cast<Undefined>(s)) {
         treatUndefinedSymbol(*undefined);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110040.373626.patch
Type: text/x-patch
Size: 704 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210920/917f1a99/attachment.bin>


More information about the llvm-commits mailing list