[lld] [lld-macho] Add swift support to ObjC category merger (PR #95124)
    Kyungwoo Lee via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Jun 11 20:35:43 PDT 2024
    
    
  
================
@@ -679,11 +679,16 @@ void ObjcCategoryMerger::parseProtocolListInfo(const ConcatInputSection *isec,
       (protocolCount * target->wordSize) +
       /*header(count)*/ protocolListHeaderLayout.totalSize +
       /*extra null value*/ target->wordSize;
-  assert(expectedListSize == ptrListSym->isec()->data.size() &&
+
+  // On Swift, the protocol list does not have the extra (unecessary) null value
+  uint32_t expectedListSizeSwift = expectedListSize - target->wordSize;
+
+  assert((expectedListSize == ptrListSym->isec()->data.size() ||
+          expectedListSizeSwift == ptrListSym->isec()->data.size()) &&
----------------
kyulee-com wrote:
Can we tighten the condition by checking if it's from swift or not?
https://github.com/llvm/llvm-project/pull/95124
    
    
More information about the llvm-commits
mailing list