[lld] r258670 - Use of assert instead of llvm_unreachable in EhFrameHeader<ELFT>::assignEhFrame().

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 25 11:07:56 PST 2016


On Mon, Jan 25, 2016 at 12:20 AM, George Rimar via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: grimar
> Date: Mon Jan 25 02:20:16 2016
> New Revision: 258670
>
> URL: http://llvm.org/viewvc/llvm-project?rev=258670&view=rev
> Log:
> Use of assert instead of llvm_unreachable in
> EhFrameHeader<ELFT>::assignEhFrame().
>
> 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=258670&r1=258669&r2=258670&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/OutputSections.cpp (original)
> +++ lld/trunk/ELF/OutputSections.cpp Mon Jan 25 02:20:16 2016
> @@ -862,7 +862,7 @@ template <class ELFT> void EhFrameHeader
>  template <class ELFT>
>  void EhFrameHeader<ELFT>::assignEhFrame(EHOutputSection<ELFT> *Sec) {
>    if (this->Sec && this->Sec != Sec)
> -    llvm_unreachable("multiple .eh_frame sections not supported for
> .eh_frame_hdr");
> +    assert("multiple .eh_frame sections not supported for .eh_frame_hdr");
>

This assertion will never fail because converting a string to a boolean is
always true (a non-null pointer is always true)

This should be:

assert((!this->Sec || this->Sec == Sec) && "multiple .eh_frame sections ...
");


>    Live = Config->EhFrameHdr;
>    this->Sec = Sec;
>  }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160125/d40a2c84/attachment.html>


More information about the llvm-commits mailing list