[lld] r258707 - Fix: added assert condition to EhFrameHeader<ELFT>::assignEhFrame().

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 25 11:27:50 PST 2016


Author: grimar
Date: Mon Jan 25 13:27:50 2016
New Revision: 258707

URL: http://llvm.org/viewvc/llvm-project?rev=258707&view=rev
Log:
Fix: added assert condition to EhFrameHeader<ELFT>::assignEhFrame().
Thanks to David Blaikie who found that issue.

Modified:
    lld/trunk/ELF/OutputSections.cpp

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=258707&r1=258706&r2=258707&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Mon Jan 25 13:27:50 2016
@@ -861,8 +861,8 @@ template <class ELFT> void EhFrameHeader
 
 template <class ELFT>
 void EhFrameHeader<ELFT>::assignEhFrame(EHOutputSection<ELFT> *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;
 }




More information about the llvm-commits mailing list