diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index fd08dfbb0f56..53835cb9bd20 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -861,8 +861,8 @@ template void EhFrameHeader::writeTo(uint8_t *Buf) { template void EhFrameHeader::assignEhFrame(EHOutputSection *Sec) { - if (this->Sec && this->Sec != Sec) - assert("multiple .eh_frame sections not supported for .eh_frame_hdr"); + assert((!this->Sec || this->Sec == Sec) && + "multiple .eh_frame sections not supported for .eh_frame_hdr"); Live = Config->EhFrameHdr; this->Sec = Sec; }