Skip to content

Commit 0412840

Browse files
committed
[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"); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 parent 936519f commit 0412840

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lld/MachO/ObjC.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,8 +613,8 @@ void ObjcCategoryMerger::collectCategoryWriterInfoFromCategory(
613613
void ObjcCategoryMerger::parseProtocolListInfo(const ConcatInputSection *isec,
614614
uint32_t secOffset,
615615
PointerListInfo &ptrList) {
616-
if (!isec || (secOffset + target->wordSize > isec->data.size()))
617-
assert("Tried to read pointer list beyond protocol section end");
616+
assert((isec && (secOffset + target->wordSize <= isec->data.size())) &&
617+
"Tried to read pointer list beyond protocol section end");
618618

619619
const Reloc *reloc = isec->getRelocAt(secOffset);
620620
if (!reloc)

0 commit comments

Comments
 (0)