From 45ca88dbdffd1edbbe2c040ab8db13aa6f07dc87 Mon Sep 17 00:00:00 2001 From: George Rimar Date: Mon, 25 Jan 2016 19:27:50 +0000 Subject: [PATCH] Fix: added assert condition to EhFrameHeader::assignEhFrame(). Thanks to David Blaikie who found that issue. llvm-svn: 258707 --- lld/ELF/OutputSections.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }