diff options
author | Jie Fu <jiefu@tencent.com> | 2024-03-20 10:07:00 +0800 |
---|---|---|
committer | Jie Fu <jiefu@tencent.com> | 2024-03-20 10:07:00 +0800 |
commit | 0412840ef877b0b4efe117f0328ac57fc669a871 (patch) | |
tree | a44d225a6510269b47314a184ef5db497cd01027 /lld/MachO | |
parent | 936519f25cb4fabc19f1241e838e938926801156 (diff) | |
download | llvm-0412840ef877b0b4efe117f0328ac57fc669a871.zip llvm-0412840ef877b0b4efe117f0328ac57fc669a871.tar.gz llvm-0412840ef877b0b4efe117f0328ac57fc669a871.tar.bz2 |
[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");
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Diffstat (limited to 'lld/MachO')
-rw-r--r-- | lld/MachO/ObjC.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lld/MachO/ObjC.cpp b/lld/MachO/ObjC.cpp index f541276..40df224 100644 --- a/lld/MachO/ObjC.cpp +++ b/lld/MachO/ObjC.cpp @@ -613,8 +613,8 @@ void ObjcCategoryMerger::collectCategoryWriterInfoFromCategory( 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) |