[lld] [lld-macho] Fix address sanitizer for category merging (PR #91680)

Ellis Hoag via llvm-commits llvm-commits at lists.llvm.org
Thu May 9 16:52:16 PDT 2024


================
@@ -1148,7 +1148,7 @@ void ObjcCategoryMerger::generateCatListForNonErasedCategories(
       assert(nonErasedCatBody && "Failed to relocate non-deleted category");
 
       // Allocate data for the new __objc_catlist slot
-      auto bodyData = newSectionData(target->wordSize);
+      llvm::ArrayRef<uint8_t> bodyData = newSectionData(target->wordSize);
----------------
ellishg wrote:

I think using `auto &` would have also been ok. But since this is a constant, it is preferred to use `ArrayRef<>` over `const SmallVector<> &`.

https://github.com/llvm/llvm-project/pull/91680


More information about the llvm-commits mailing list