[lld] Fix -Wstring-conversion in ObjC.cpp (NFC)
llvm-project/lld/MachO/ObjC.cpp:617:12:
error: implicit conversion turns string literal into bool: 'const char[55]' to 'bool' [-Werror,-Wstring-conversion]
617 | assert("Tried to read pointer list beyond protocol section end");
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GitOrigin-RevId: 0412840ef877b0b4efe117f0328ac57fc669a871
diff --git a/MachO/ObjC.cpp b/MachO/ObjC.cpp
index f541276..40df224 100644
--- a/MachO/ObjC.cpp
+++ b/MachO/ObjC.cpp
@@ -613,8 +613,8 @@
void ObjcCategoryMerger::parseProtocolListInfo(const ConcatInputSection *isec,
uint32_t secOffset,
PointerListInfo &ptrList) {
- if (!isec || (secOffset + target->wordSize > isec->data.size()))
- assert("Tried to read pointer list beyond protocol section end");
+ assert((isec && (secOffset + target->wordSize <= isec->data.size())) &&
+ "Tried to read pointer list beyond protocol section end");
const Reloc *reloc = isec->getRelocAt(secOffset);
if (!reloc)